~ubuntu-branches/ubuntu/hardy/sigscheme/hardy-proposed

« back to all changes in this revision

Viewing changes to doc/style.txt

  • Committer: Bazaar Package Importer
  • Author(s): NIIBE Yutaka
  • Date: 2006-05-23 21:46:41 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20060523214641-6ix4gz34wpiehub8
Tags: 0.5.0-2
* debian/control (Build-Depends): Added ruby.
  Thanks to Frederik Schueler.  Closes: #368571
* debian/rules (clean): invoke 'distclean' instead of 'clean'.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Coding style
 
2
 
 
3
* Cosmetic style
 
4
 
 
5
  C:
 
6
    indent-tabs-mode: nil
 
7
    fill-column: 79
 
8
    c-basic-offset: 4
 
9
    substatement-open: 0
 
10
    c-backslash-column: 77
 
11
 
 
12
  Scheme:
 
13
    (put 'and-let* 'scheme-indent-function 1)
 
14
    (put 'receive 'scheme-indent-function 2)
 
15
    (put 'with-exception-handler 'scheme-indent-function 1)
 
16
    (put 'guard 'scheme-indent-function 1)
 
17
 
 
18
  The value 77 for c-backslash-column is selected to maximize writable space,
 
19
  eliminate jagged end of lines and prevent overflow of lines on diffs posted
 
20
  to the uim-commit list.
 
21
 
 
22
  Avoid placing a character at column 80 even if your editor displays it
 
23
  without overflow in 80-column window. Many editor displays it as continuance
 
24
  mark or folding mark. i.e. Treat column 79 as end-of-line, especially for
 
25
  decorations for comments.
 
26
 
 
27
 
 
28
* Macro definition
 
29
 
 
30
  Any argument should be wrapped into () or [] if no exceptional reason exist,
 
31
  to prevent unintended operator associations.
 
32
 
 
33
    #define SCM_CONS_SET_CAR(a, car)   (SCM_CAR(a) = (car))
 
34
 
 
35
  And ultra-cowardively, passing an argument to another function or macro is
 
36
  should also be wrapped as follows.
 
37
 
 
38
    #define SCM_CONS(kar, kdr) (Scm_NewCons((kar), (kdr)))
 
39
 
 
40
  This is intended to endure unconditional safety against rare-cases such as
 
41
  follows.
 
42
 
 
43
    #define FOO assert(), get_foo()
 
44
    #define MAKE_LIST2(x, y) make_list(x, y)
 
45
    
 
46
    MAKE_LIST2(FOO, SCM_FALSE);
 
47
    /* => make_list(assert(), get_foo(), SCM_FALSE) */
 
48
 
 
49
 
 
50
* Macro invocation
 
51
 
 
52
  Don't pass a destructive or side-effective expression to a SigScheme macro as
 
53
  an argument (e.g. CONTINUATIONP(continuation_stack_unwind(cont))), because
 
54
  there's an possibility that continuation_stack_unwind() is evaluated multiple
 
55
  times after the macro expantion.