aboutsummaryrefslogtreecommitdiff
path: root/dev/style.txt
blob: 2e597dc45a85314dad522372c3d4f6c981827365 (plain)
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-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