diff options
author | Samuel Mimram <samuel.mimram@ens-lyon.org> | 2004-07-28 21:54:47 +0000 |
---|---|---|
committer | Samuel Mimram <samuel.mimram@ens-lyon.org> | 2004-07-28 21:54:47 +0000 |
commit | 6b649aba925b6f7462da07599fe67ebb12a3460e (patch) | |
tree | 43656bcaa51164548f3fa14e5b10de5ef1088574 /dev/style.txt |
Imported Upstream version 8.0pl1upstream/8.0pl1
Diffstat (limited to 'dev/style.txt')
-rw-r--r-- | dev/style.txt | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/dev/style.txt b/dev/style.txt new file mode 100644 index 00000000..2e597dc4 --- /dev/null +++ b/dev/style.txt @@ -0,0 +1,49 @@ + +<< L'uniformité du style est plus importante que le style lui-même. >> +(Kernigan & Pike, The Practice of Programming) + +Mode Emacs +========== + Tuareg, que l'on trouve ici : http://www.prism.uvsq.fr/~acohen/tuareg/ + + avec le réglage suivant : (setq tuareg-in-indent 2) + +Types récursifs et filtrages +============================ + Une barre de séparation y compris sur le premier constructeur + +type t = + | A + | B of machin + +match expr with + | A -> ... + | B x -> ... + + +Conditionnelles +=============== + if condition then + premier-cas + else + deuxieme-cas + + Si effets de bord dans les branches, utilisez begin ... end et non des + parenthèses i.e. + + if condition then begin + instr1; + instr2 + end else begin + instr3; + instr4 + end + + Si la première branche lève une exception, évitez le else i.e. + + if condition then if condition then error "machin"; + error "machin" -----> suite + else + suite + + |