1
(declare (unit precsi))
2
(declare (uses example))
4
;; display prelude to csi
5
(display "constants\n\n")
7
(display " A SWIG example for the CHICKEN compiler\n")
8
(display " Author: Jonah Beckford, December 2002\n\n")
10
(display "C Procedures:\n")
11
(display " #define ICONST 42\n")
12
(display " #define FCONST 2.1828\n")
13
(display " #define CCONST 'x'\n")
14
(display " #define CCONST2 '\n'\n")
15
(display " #define SCONST \"Hello World\"\n")
16
(display " #define SCONST2 \"\\\"Hello World\\\"\"\n")
17
(display " /* This should work just fine */\n")
18
(display " #define EXPR ICONST + 3*(FCONST)\n")
19
(display " /* This shouldn't do anything */\n")
20
(display " #define EXTERN extern\n")
21
(display " /* Neither should this (BAR isn't defined) */\n")
22
(display " #define FOO (ICONST + BAR)\n")
23
(display " /* The following directives also produce constants. Remember that\n")
24
(display " CHICKEN is normally case-insensitive, so don't rely on differing\n")
25
(display " case to differentiate variable names */\n")
26
(display " %constant int iconstX = 37;\n")
27
(display " %constant double fconstX = 3.14;\n")
30
(display "Scheme Procedures:\n")
31
(display " (example:ICONST)\n")
32
(display " (example:FCONST)\n")
33
(display " (example:CCONST)\n")
34
(display " (example:CCONST2)\n")
35
(display " (example:SCONST)\n")
36
(display " (example:SCONST2)\n")
37
(display " (example:EXPR)\n")
38
(display " (example:EXTERN)\n")
39
(display " (example:FOO)\n")
40
(display " (example:iconstX)\n")
41
(display " (example:fconstX)\n")