File: style.txt

package info (click to toggle)
coq 8.0pl2-2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 14,228 kB
  • ctags: 17,685
  • sloc: ml: 97,070; makefile: 1,255; sh: 738; lisp: 456; awk: 15
file content (49 lines) | stat: -rw-r--r-- 982 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49

<< L'uniformit du style est plus importante que le style lui-mme. >>
(Kernigan & Pike, The Practice of Programming)

Mode Emacs
==========
   Tuareg, que l'on trouve ici :  http://www.prism.uvsq.fr/~acohen/tuareg/

   avec le rglage suivant :     (setq tuareg-in-indent 2)

Types rcursifs et filtrages
============================
   Une barre de sparation 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
  parenthses i.e.

  if condition then begin
    instr1;
    instr2
  end else begin
    instr3;
    instr4
  end
    
  Si la premire branche lve une exception, vitez le else i.e.

    if condition then                     if condition then error "machin";
      error "machin"          ----->      suite
    else
      suite