diff options
| author | filliatr | 1999-11-26 08:40:36 +0000 |
|---|---|---|
| committer | filliatr | 1999-11-26 08:40:36 +0000 |
| commit | ede38b4961bba30017d721050daec62c4ec0c906 (patch) | |
| tree | e9a8c1a505bd1885ba559e24a42c01c7fe396a2f /dev | |
| parent | 45800868bf532be4348ab7025144e4caec5c3a83 (diff) | |
style utilise dans le code
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@146 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'dev')
| -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 0000000000..2e597dc45a --- /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 + + |
