diff options
author | Samuel Mimram <smimram@debian.org> | 2006-06-16 14:41:51 +0000 |
---|---|---|
committer | Samuel Mimram <smimram@debian.org> | 2006-06-16 14:41:51 +0000 |
commit | e978da8c41d8a3c19a29036d9c569fbe2a4616b0 (patch) | |
tree | 0de2a907ee93c795978f3c843155bee91c11ed60 /dev/doc/style.txt | |
parent | 3ef7797ef6fc605dfafb32523261fe1b023aeecb (diff) |
Imported Upstream version 8.0pl3+8.1betaupstream/8.0pl3+8.1beta
Diffstat (limited to 'dev/doc/style.txt')
-rw-r--r-- | dev/doc/style.txt | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/dev/doc/style.txt b/dev/doc/style.txt new file mode 100644 index 00000000..2e597dc4 --- /dev/null +++ b/dev/doc/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 + + |