Changeset 5393 in project


Ignore:
Timestamp:
08/13/07 08:19:13 (13 years ago)
Author:
felix winkelmann
Message:

manual sync, site index points to current snapshort link

Location:
chicken/trunk
Files:
22 edited

Legend:

Unmodified
Added
Removed
  • chicken/trunk/chicken-build.scm

    r5374 r5393  
    7272(define DEBUG #t)                       ;* testing
    7373(define SHARED_LIB_EXTENSION #f)
    74 (define MANUALDIR (path (current-directory) "../wiki"))
    75 (define WIKIEXTENSIONS (path (current-directory) "../stream-wiki/tags/1.9/extensions"))
     74(define MANUALDIR (path (current-directory) "manual"))
     75(define WIKIEXTENSIONS (path (current-directory) "../../stream-wiki/tags/1.9/extensions"))
    7676(define INCLUDES "-I.")
    7777(define INSTALL_PROGRAM #f)
     
    721721  (actions
    722722   "do" "manualsync"
    723    (lambda () (run (rsync -av --existing ,(conc MANUALDIR "/") manual/))))
     723   (lambda () (run (rsync -av --exclude=.svn --existing ,(conc MANUALDIR "/") manual/))))
    724724  (notfile "doc")
    725725  (actions
    726726   "doc"
    727727   (lambda ()
    728      (run (,CSI -s misc/makedoc --pdf --extension-path= ,WIKIEXTENSIONS))
    729      (run (cp chicken.pdf site)) ) ) )
     728     (run (,CSI -s misc/makedoc.scm --pdf --extension-path= ,WIKIEXTENSIONS))
     729     (run (cp chicken.pdf site)) ) )
     730  (notfile "texi")
     731  (actions "texi" (lambda () (run (,CSI -s misc/maketexi.scm ,MANUALDIR)))))
    730732
    731733
  • chicken/trunk/manual/Basic mode of operation

    r5220 r5393  
    4848they are defined at compile time, i.e the time when that other unit
    4949was compiled (macros can optionally be
    50 available at runtime, see {{define-macro}} in [[Non standard macros and special forms|Substitution forms and macros]]).
     50available at runtime, see {{define-macro}} in [[Non-standard macros and special forms|Substitution forms and macros]]).
    5151
    5252On platforms that support dynamic loading of compiled code ( Windows, most ELF based
  • chicken/trunk/manual/C interface

    r2488 r5393  
    213213 [C macro] C_word C_u_i_car (C_word x)
    214214
    215 === C_u_i_car
    216 
    217  [C macro] C_word C_u_i_car (C_word x)
     215=== C_u_i_cdr
     216
     217 [C macro] C_word C_u_i_cdr (C_word x)
    218218
    219219Aliases for {{C_block_item(x, 0)}} and {{C_block_item(x, 1)}}, respectively.
  • chicken/trunk/manual/Data representation

    r5220 r5393  
    11[[tags: manual]]
    22
    3 == Data Representation
     3== Data representation
    44
    55''Note: In all cases below, bits are numbered starting
  • chicken/trunk/manual/Extensions to the standard

    r5220 r5393  
    1111
    1212[4] Numerous non-standard macros are provided. See
    13 [[Non standard macros and special forms]] for more information.
     13[[Non-standard macros and special forms]] for more information.
    1414
    1515[4.1.4] Extended DSSSL style lambda lists are supported. DSSSL formal argument lists are defined by the following grammar:
  • chicken/trunk/manual/Foreign type specifiers

    r5220 r5393  
    199199as a {{NULL}} pointer.
    200200
    201 == Mappings
     201=== Mappings
    202202
    203203Foreign types are mapped to C types in the following manner:
  • chicken/trunk/manual/Non standard macros and special forms

    r5220 r5393  
    55== Non-standard macros and special forms
    66
    7 === Making extra libraries and extensions available
     7=== Making extra libraries and extensions availablee
    88
    99==== require-extension
     
    368368=== Conditional forms
    369369
    370 ==== switch
    371 
    372  [syntax] (switch EXP (KEY EXP1 ...) ... [(else EXPn ...)])
    373 
    374 This is similar to {{case}}, but a) only a single key is allowed,
    375 and b) the key is evaluated.
     370==== select
     371
     372 [syntax] (select EXP ((KEY ...) EXP1 ...) ... [(else EXPn ...)])
     373
     374This is similar to {{case}}, but the keys are evaluated.
    376375
    377376==== unless
  • chicken/trunk/manual/Non standard read syntax

    r2926 r5393  
    133133Previous: [[Extensions to the standard]]
    134134
    135 Next: [[Non standard macros and special forms]]
     135Next: [[Non-standard macros and special forms]]
  • chicken/trunk/manual/Other support procedures

    r2488 r5393  
    22[[toc:]]
    33
    4 === Other support procedures
     4== Other support procedures
    55
    66=== argc+argv
  • chicken/trunk/manual/Pattern matching

    r2488 r5393  
    22[[toc:]]
    33
    4 == Pattern Matching
     4== Pattern matching
    55
    66(This description has been taken mostly from Andrew Wright's postscript
     
    404404This name also should not be shadowed.
    405405
    406 Previous: [[Non standard macros and special forms]]
     406Previous: [[Non-standard macros and special forms]]
    407407
    408408Next: [[Declarations]]
  • chicken/trunk/manual/The User's Manual

    r5220 r5393  
    11[[tags:manual]]
    22
    3 == Introduction
     3== The User's Manual
    44
    5 ''(This document describes version 2.630)''
     5''(This document describes version 2.635)''
    66
    77'''CHICKEN is a compiler that translates Scheme source files into C''', which in
  • chicken/trunk/manual/Unit library

    r5220 r5393  
    1010
    1111
    12 ==== add1
    13 ==== sub1
    14 
    15  [procedure] (add1 N)
    16  [procedure] (sub1 N)
     12==== add1/sub1
     13
     14; [procedure] (add1 N)
     15; [procedure] (sub1 N)
    1716
    1817Adds/subtracts 1 from {{N}}.
    1918
    20 
    21 ==== bitwise-and
    22 ==== bitwise-ior
    23 ==== bitwise-xor
    24 ==== bitwise-not
    25 ==== arithmetic-shift
    26 
    27  [procedure] (bitwise-and N1 ...)
    28  [procedure] (bitwise-ior N1 ...)
    29  [procedure] (bitwise-xor N1 ...)
    30  [procedure] (bitwise-not N)
    31  [procedure] (arithmetic-shift N1 N2)
     19==== Binary integer operations
    3220
    3321Binary integer operations. {{arithmetic-shift}} shifts the argument
    34 {{N1}} by {{N2}} bits to the left. If {{N2}} is negative,
    35 than {{N1}} is shifted to the right.
    36 These operations only accept exact integers or inexact integers in word range
    37 (32 bit signed on 32-bit platforms, or 64 bit signed on 64-bit platforms).
     22{{N1}} by {{N2}} bits to the left. If {{N2}} is negative, than {{N1}}
     23is shifted to the right.  These operations only accept exact integers
     24or inexact integers in word range (32 bit signed on 32-bit platforms,
     25or 64 bit signed on 64-bit platforms).
     26
     27; [procedure] (bitwise-and N1 ...)
     28; [procedure] (bitwise-ior N1 ...)
     29; [procedure] (bitwise-xor N1 ...)
     30; [procedure] (bitwise-not N)
     31; [procedure] (arithmetic-shift N1 N2)
    3832
    3933==== bit-set?
     
    5145Returns {{#t}} if {{X}} is a fixnum, or {{#f}} otherwise.
    5246
    53 
    54 ==== fx+
    55 ==== fx-
    56 ==== fx*
    57 ==== fx/
    58 ==== fxmod
    59 ==== fxneg
    60 ==== fxmin
    61 ==== fxmax
    62 ==== fx=
    63 ==== fx>
    64 ==== fx<
    65 ==== fx>=
    66 ==== fx<=
    67 ==== fxand
    68 ==== fxior
    69 ==== fxxor
    70 ==== fxnot
    71 ==== fxshl
    72 ==== fxshr
    73 
    74  [procedure] (fx+ N1 N2)
    75  [procedure] (fx- N1 N2)
    76  [procedure] (fx* N1 N2)
    77  [procedure] (fx/ N1 N2)
    78  [procedure] (fxmod N1 N2)
    79  [procedure] (fxneg N)
    80  [procedure] (fxmin N1 N2)
    81  [procedure] (fxmax N1 N2)
    82  [procedure] (fx= N1 N2)
    83  [procedure] (fx> N1 N2)
    84  [procedure] (fx< N1 N2)
    85  [procedure] (fx>= N1 N2)
    86  [procedure] (fx<= N1 N2)
    87  [procedure] (fxand N1 N2)
    88  [procedure] (fxior N1 N2)
    89  [procedure] (fxxor N1 N2)
    90  [procedure] (fxnot N)
    91  [procedure] (fxshl N1 N2)
    92  [procedure] (fxshr N1 N2)
    93 
    94 Arithmetic fixnum operations. These procedures do not check their
    95 arguments, so non-fixnum parameters will result in incorrect
    96 results. {{fxneg}} negates its argument.
    97 
    98 On division by zero, {{fx/}} and {{fxmod}} signal a condition of
    99 kind {{(exn arithmetic)}}.
     47==== Arithmetic fixnum operations
     48
     49These procedures do not check their arguments, so non-fixnum
     50parameters will result in incorrect results. {{fxneg}} negates its
     51argument.
     52
     53On division by zero, {{fx/}} and {{fxmod}} signal a condition of kind
     54{{(exn arithmetic)}}.
    10055
    10156{{fxshl}} and {{fxshr}} perform arithmetic shift left and right,
    10257respectively.
    10358
    104 
    105 ==== flonum?
    106 ==== fp+
    107 ==== fp-
    108 ==== fp*
    109 ==== fp/
    110 ==== fpneg
    111 ==== fpmin
    112 ==== fpmax
    113 ==== fp=
    114 ==== fp>
    115 ==== fp<
    116 ==== fp>=
    117 ==== fp<=
    118 
    119  [procedure] (flonum? X)
    120  [procedure] (fp+ X Y)
    121  [procedure] (fp- X Y)
    122  [procedure] (fp* X Y)
    123  [procedure] (fp/ X Y)
    124  [procedure] (fpneg X)
    125  [procedure] (fpmin X Y)
    126  [procedure] (fpmax X Y)
    127  [procedure] (fp= X Y)
    128  [procedure] (fp> X Y)
    129  [procedure] (fp< X Y)
    130  [procedure] (fp>= X Y)
    131  [procedure] (fp<= X Y)
    132 
    133 Arithmetic floating-point operations. In safe mode, these procedures throw a type error with non-float arguments (except {{flonum?}}, which returns {{#f}}).  In unsafe mode, these procedures do not check their arguments.  A non-flonum argument in unsafe mode can crash the system.
     59; [procedure] (fx+ N1 N2)
     60; [procedure] (fx- N1 N2)
     61; [procedure] (fx* N1 N2)
     62; [procedure] (fx/ N1 N2)
     63; [procedure] (fxmod N1 N2)
     64; [procedure] (fxneg N)
     65; [procedure] (fxmin N1 N2)
     66; [procedure] (fxmax N1 N2)
     67; [procedure] (fx= N1 N2)
     68; [procedure] (fx> N1 N2)
     69; [procedure] (fx< N1 N2)
     70; [procedure] (fx>= N1 N2)
     71; [procedure] (fx<= N1 N2)
     72; [procedure] (fxand N1 N2)
     73; [procedure] (fxior N1 N2)
     74; [procedure] (fxxor N1 N2)
     75; [procedure] (fxnot N)
     76; [procedure] (fxshl N1 N2)
     77; [procedure] (fxshr N1 N2)
     78
     79
     80==== Arithmetic floating-point operations
     81
     82In safe mode, these procedures throw a type error with non-float
     83arguments (except {{flonum?}}, which returns {{#f}}).  In unsafe mode,
     84these procedures do not check their arguments.  A non-flonum argument
     85in unsafe mode can crash the system.
     86
     87; [procedure] (flonum? X)
     88; [procedure] (fp+ X Y)
     89; [procedure] (fp- X Y)
     90; [procedure] (fp* X Y)
     91; [procedure] (fp/ X Y)
     92; [procedure] (fpneg X)
     93; [procedure] (fpmin X Y)
     94; [procedure] (fpmax X Y)
     95; [procedure] (fp= X Y)
     96; [procedure] (fp> X Y)
     97; [procedure] (fp< X Y)
     98; [procedure] (fp>= X Y)
     99; [procedure] (fp<= X Y)
    134100
    135101
     
    181147==== port-name
    182148
    183  [procedure] (port-name PORT)
     149 [procedure] (port-name [PORT])
    184150
    185151Fetch filename from {{PORT}}. This returns the filename that was
    186152used to open this file.  Returns a special tag string, enclosed into
    187 parentheses for non-file ports.
     153parentheses for non-file ports. {{PORT}} defaults to the value of {{(current-input-port)}}.
    188154
    189155
    190156==== port-position
    191157
    192  [procedure] (port-position PORT)
     158 [procedure] (port-position [PORT])
    193159
    194160Returns the current position of {{PORT}} as two values: row and
    195161column number.  If the port does not support such an operation an error
    196162is signaled. This procedure is currently only available for input ports.
     163{{PORT}} defaults to the value of {{(current-input-port)}}.
    197164
    198165
     
    595562 sparc
    596563 ppc
     564 ppc64
    597565 ia64
    598566 x86
  • chicken/trunk/manual/Unit lolevel

    r5220 r5393  
    1 [[tags: manual]]
     1[[tags: manual internals]]
    22[[toc:]]
    33
  • chicken/trunk/manual/Unit posix

    r5220 r5393  
    145145  (lambda ()
    146146    (print #<<EOF
    147 %!IOPSC-1993 %%Creator: HAYAKAWA Takashi<xxxxxxxx@xx.xxxxxx.xx.xx>
    148 /C/neg/d/mul/R/rlineto/E/exp/H{{cvx def}repeat}def/T/dup/g/gt/r/roll/J/ifelse 8
    149 H/A/copy(z&v4QX&93r9AxYQOZomQalxS2w!!O&vMYa43d6r93rMYvx2dca!D&cjSnjSnjjS3o!v&6A
    150 X&55SAxM1CD7AjYxTTd62rmxCnTdSST0g&12wECST!&!J0g&D1!&xM0!J0g!l&544dC2Ac96ra!m&3A
    151 F&&vGoGSnCT0g&wDmlvGoS8wpn6wpS2wTCpS1Sd7ov7Uk7o4Qkdw!&Mvlx1S7oZES3w!J!J!Q&7185d
    152 Z&lx1CS9d9nE4!k&X&MY7!&1!J!x&jdnjdS3odS!N&mmx1C2wEc!G&150Nx4!n&2o!j&43r!U&0777d
    153 ]&2AY2A776ddT4oS3oSnMVC00VV0RRR45E42063rNz&v7UX&UOzF!F!J![&44ETCnVn!a&1CDN!Y&0M
    154 V1c&j2AYdjmMdjjd!o&1r!M){( )T 0 4 3 r put T(/)g{T(9)g{cvn}{cvi}J}{($)g[]J}J
    155 cvx}forall/moveto/p/floor/w/div/S/add 29 H[{[{]setgray fill}for Y}for showpage
    156 EOF
    157 ) ) )
     147 %!IOPSC-1993 %%Creator: HAYAKAWA Takashi<xxxxxxxx@xx.xxxxxx.xx.xx>
     148 /C/neg/d/mul/R/rlineto/E/exp/H{{cvx def}repeat}def/T/dup/g/gt/r/roll/J/ifelse 8
     149 H/A/copy(z&v4QX&93r9AxYQOZomQalxS2w!!O&vMYa43d6r93rMYvx2dca!D&cjSnjSnjjS3o!v&6A
     150 X&55SAxM1CD7AjYxTTd62rmxCnTdSST0g&12wECST!&!J0g&D1!&xM0!J0g!l&544dC2Ac96ra!m&3A
     151 F&&vGoGSnCT0g&wDmlvGoS8wpn6wpS2wTCpS1Sd7ov7Uk7o4Qkdw!&Mvlx1S7oZES3w!J!J!Q&7185d
     152 Z&lx1CS9d9nE4!k&X&MY7!&1!J!x&jdnjdS3odS!N&mmx1C2wEc!G&150Nx4!n&2o!j&43r!U&0777d
     153 ]&2AY2A776ddT4oS3oSnMVC00VV0RRR45E42063rNz&v7UX&UOzF!F!J![&44ETCnVn!a&1CDN!Y&0M
     154 V1c&j2AYdjmMdjjd!o&1r!M){( )T 0 4 3 r put T(/)g{T(9)g{cvn}{cvi}J}{($)g[]J}J
     155 cvx}forall/moveto/p/floor/w/div/S/add 29 H[{[{]setgray fill}for Y}for showpage
     156 EOF
     157 ) ) )
    158158</enscript>
    159159
     
    248248output, respectively. If the optional argument {{TIMEOUT}} is
    249249given and not false, then it should specify the number of seconds after
    250 which the wait is to be aborted. This procedure returns two values:
     250which the wait is to be aborted (the value may be a floating point
     251number). This procedure returns two values:
    251252the lists of file-descriptors ready for input and output, respectively.
    252253{{READFDLIST}} and '''WRITEFDLIST''' may also by file-descriptors
  • chicken/trunk/manual/Unit regex

    r5220 r5393  
    159159</enscript>
    160160
     161Note that a regular expression that matches an empty string will
     162signal an error.
     163
    161164
    162165=== string-substitute*
  • chicken/trunk/manual/Unit tcp

    r3241 r5393  
    4242 [procedure] (tcp-accept LISTENER)
    4343
    44 Waits until a connection is established on the port on which {{LISTENER}} is listening and
    45 returns two values: an input- and output-port that can be used to communicate with the
    46 remote process.
    47 
    48 Note: this operation and any I/O on the ports returned will not block other running threads.
     44Waits until a connection is established on the port on which
     45{{LISTENER}} is listening and returns two values: an input- and
     46output-port that can be used to communicate with the remote
     47process. The current value of {{tcp-accept-timeout}} is used to
     48determine the maximal number of milliseconds (if any) to wait
     49until a connection is established. When a client connects any
     50read- and write-operations on the returned ports will use the
     51current values (at the time of the connection) of {{tcp-read-timeout}}
     52and {{tcp-write-timeout}}, respectively, to determine the maximal
     53number of milliseconds to wait for input/output before a timeout
     54error is signalled.
     55
     56Note: this operation and any I/O on the ports returned will not block
     57other running threads.
    4958
    5059
     
    6675=== tcp-listener-fileno
    6776
    68  [procedure] (tcp-listener-port LISTENER)
     77 [procedure] (tcp-listener-fileno LISTENER)
    6978
    7079Returns the file-descriptor associated with {{LISTENER}}.
     
    7584 [procedure] (tcp-connect HOSTNAME [TCPPORT])
    7685
    77 Establishes a client-side TCP connection to the machine with the name {{HOSTNAME}} (a string)
    78 at {{TCPPORT}} (an exact integer) and returns two values: an input- and output-port for communicating
    79 with the remote process.
     86Establishes a client-side TCP connection to the machine with the name
     87{{HOSTNAME}} (a string) at {{TCPPORT}} (an exact integer) and returns
     88two values: an input- and output-port for communicating with the
     89remote process. The current value of {{tcp-connect-timeout}} is used
     90to determine the maximal number of milliseconds (if any) to wait until
     91the connection is established. When the connection takes place any
     92read- and write-operations on the returned ports will use the current
     93values (at the time of the call to {{tcp-connect}}) of {{tcp-read-timeout}} and
     94{{tcp-write-timeout}}, respectively, to determine the maximal number
     95of milliseconds to wait for input/output before a timeout error is
     96signalled.
     97
     98If the {{TCPPORT}} is omitted, the port is parsed from the {{HOSTNAME}} string.  The format expected is {{HOSTNAME:PORT}}.  The {{PORT}} can either be a string representation of an integer or a service name which is translated to an integer using the POSIX function [[http://www.opengroup.org/onlinepubs/009695399/functions/getservbyname.html|{{getservbyname}}]].
    8099
    81100Note: any I/O on the ports returned will not block other running threads.
     
    125144Closing the output port will flush automatically.
    126145
    127 == Example
     146=== tcp-read-timeout
     147
     148 [parameter] tcp-read-timeout
     149
     150Determines the timeout for TCP read operations in milliseconds. A timeout of
     151{{#f}} disables timeout checking and is the default.
     152
     153=== tcp-write-timeout
     154
     155 [parameter] tcp-write-timeout
     156
     157Determines the timeout for TCP write operations in milliseconds. A timeout of
     158{{#f}} disables timeout checking and is the default.
     159
     160
     161=== tcp-connect-timeout
     162
     163 [parameter] tcp-connect-timeout
     164
     165Determines the timeout for {{tcp-connect}} operations in milliseconds. A timeout of
     166{{#f}} disables timeout checking and is the default.
     167
     168
     169=== tcp-accept-timeout
     170
     171 [parameter] tcp-accept-timeout
     172
     173Determines the timeout for {{tcp-accept}} operations in milliseconds. A timeout of
     174{{#f}} disables timeout checking and is the default.
     175
     176
     177=== Example
    128178
    129179A very simple example follows. Say we have the two files {{client.scm}}
  • chicken/trunk/manual/Unit utils

    r5220 r5393  
    66
    77This unit contains file/pathname oriented procedures, apropos, plus acts as a "grab bag" for procedures without a good home,
    8 and which don't have to be available by default (as compared to the [[Unit extras|extras]] unit.
     8and which don't have to be available by default (as compared to the [[Unit extras|extras]] unit).
    99
    1010This unit uses the {{extras}} and {{regex}} units.
     
    1717 [procedure] (apropos SYMBOL-PATTERN [ENVIRONMENT] [#:MACROS?])
    1818
    19 Displays symbols & type matching {{SYMBOL-PATTERN}} in the {{ENVIRONMENT} on the {{(current-output-port)}}.
     19Displays symbols & type matching {{SYMBOL-PATTERN}} in the {{ENVIRONMENT}} on the {{(current-output-port)}}.
    2020
    2121; {{SYMBOL-PATTERN}} : A symbol, string, or regex. When symbol or string substring matching is performed.
  • chicken/trunk/manual/Using the compiler

    r5220 r5393  
    22[[toc:]]
    33
    4 == Introduction
     4== Using the compiler
    55
    66The interface to {{chicken}} is intentionally simple.  System
     
    1414on the command line for more information.
    1515
    16 == Compiler command line format
     16=== Compiler command line format
    1717
    1818 chicken FILENAME {OPTION}
     
    194194with default command-line options for the compiler.
    195195
    196 == Runtime options
     196=== Runtime options
    197197
    198198After successful compilation a C source file is generated and can be
     
    202202; {{-:?}} : Shows a list of the available runtime options and exits the program.
    203203
     204; {{-:aNUMBER}} : Specifies the length of the buffer for recording a trace of the last invoked procedures. Defaults to 16.
     205
    204206; {{-:b}} : Enter a read-eval-print-loop when an error is encountered.
    205207
     208; {{-:B}} : Sounds a bell (ASCII 7) on every major garbage collection.
     209
    206210; {{-:c}} : Forces console mode. Currently this is only used in the interpreter ({{csi}}) to force output of the {{#;N>}} prompt even if stdin is not a terminal (for example if running in an {{emacs}} buffer under Windows).
    207211
     
    210214; {{-:D}} : Prints some more debug-information at runtime.
    211215
     216; {{-:fNUMBER}} : Specifies the maximal number of currently pending finalizers before finalization is forced.
     217
    212218; {{-:hNUMBER}} : Specifies fixed heap size
    213219
     220; {{-:hgPERCENTAGE}} : Sets the growth rate of the heap in percent. If the heap is exhausted, then it will grow by {{PERCENTAGE}}. The default is 200.
     221
    214222; {{-:hiNUMBER}} : Specifies the initial heap size
    215223
    216 ; {{-:hgPERCENTAGE}} : Sets the growth rate of the heap in percent. If the heap is exhausted, then it will grow by {{PERCENTAGE}}. The default is 200.
    217 
    218224; {{-:hmNUMBER}} : Specifies a maximal heap size. The default is (2GB - 15).
    219225
     
    222228; {{-:o}} : Disables detection of stack overflows at run-time.
    223229
     230; {{-:r}} : Writes trace output to stderr. This option has no effect with in files compiled with the {{-no-trace}} options.
     231
    224232; {{-:sNUMBER}} : Specifies stack size.
    225233
    226234; {{-:tNUMBER}} : Specifies symbol table size.
    227235
    228 ; {{-:fNUMBER}} : Specifies the maximal number of currently pending finalizers before finalization is forced.
    229 
    230 ; {{-:aNUMBER}} : Specifies the length of the buffer for recording a trace of the last invoked procedures. Defaults to 16.
    231 
    232236; {{-:w}} : Enables garbage collection of unused symbols. By default unused and unbound symbols are not garbage collected.
    233237
    234 ; {{-:r}} : Writes trace output to stderr. This option has no effect with in files compiled with the {{-no-trace}} options.
    235 
    236238; {{-:x}} : Raises uncaught exceptions of separately spawned threads in primordial thread. By default uncaught exceptions in separate threads are not handled, unless the primordial one explicitly joins them. When warnings are enabled (the default) and {{-:x}} is not given, a warning will be shown, though.
    237 
    238 ; {{-:B}} : Sounds a bell (ASCII 7) on every major garbage collection.
    239239
    240240The argument values may be given in bytes, in kilobytes (suffixed with
     
    245245{{-:wh64m}} is OK, but {{-:h64mw}} will not enable GC of
    246246unused symbols.
    247 == Examples
    248 
    249 === A simple example (with one source file)
     247=== Examples
     248
     249==== A simple example (with one source file)
    250250
    251251To compile a Scheme program (assuming a UNIX-like environment) consisting of a single source file, perform the following steps.
    252252
    253 ==== Writing your source file
     253===== Writing your source file
    254254
    255255In this example we will assume your source file is called {{foo.scm}}:
     
    267267</enscript>
    268268
    269 ==== Compiling your program
     269===== Compiling your program
    270270
    271271Compile the file {{foo.scm}}:
     
    278278 foo  foo.scm
    279279
    280 ==== Running your program
     280===== Running your program
    281281
    282282To run your newly compiled executable use:
     
    287287If you get a {{foo: command not found}} error, you might want to try with {{./foo}} instead
    288288(or, in Unix machines, modify your {{PATH}} environment variable to include your current directory).
    289 === An example with multiple files
     289==== An example with multiple files
    290290
    291291If multiple bodies of Scheme code are to be combined into a single
     
    295295Let's consider an example where your program consists of multiple source files.
    296296
    297 ==== Writing your source files
     297===== Writing your source files
    298298
    299299The declarations in these files specify which of the compiled files is the main
     
    328328</enscript>
    329329
    330 ==== Compiling and running your program
     330===== Compiling and running your program
    331331
    332332You should compile your two files with the following commands:
     
    350350 % csc foo.scm bar.o -o foo
    351351
    352 Note that if you want to distribute your program, you might want it to follow the GNU Coding Standards.  One relatively easy way to achieve this is to use Autoconf and Automake, two tools made for this specific purpose.  Consult [[autoconf - automake]] for some instructions on how you would do this.
    353 == Extending the compiler
     352Note that if you want to distribute your program, you might want it to
     353follow the GNU Coding Standards.  One relatively easy way to achieve
     354this is to use Autoconf and Automake, two tools made for this specific
     355purpose.
     356
     357=== Extending the compiler
    354358
    355359The compiler supplies a couple of hooks to add user-level passes to the
     
    372376; [parameter] user-pass-2 : Holds a procedure of three arguments, which is called with the canonicalized node-graph as its sole argument. The result is ignored, so this pass has to mutate the node-structure to cause any effect.
    373377
    374 ; [parameter] user-post-analysis-pass : Holds a procedure that will be called after every performed program analysis pass. The procedure (when defined) will be called with five arguments: a symbol indicating the analysis pass, the program database, the current node graph, a getter and a setter-procedure which can be used to access and manipulate the program database, which holds various information about the compiled program. The getter procedure should be called with two arguments: a symbol representing the binding for which information should be retrieved, and a symbol that specifies the database-entry. The current value of the database entry will be returned or {{#f}}, if no such entry is available. The setter procedure is called with three arguments: the symbol and key and the new value. For information about the contents of the program database contact the author.
     378; [parameter] user-post-analysis-pass : Holds a procedure that will be called after every performed program analysis pass. The procedure (when defined) will be called with seven arguments: a symbol indicating the analysis pass, the program database, the current node graph, a getter and a setter-procedure which can be used to access and manipulate the program database, which holds various information about the compiled program, a pass iteration count, and an analysis continuation flag. The getter procedure should be called with two arguments: a symbol representing the binding for which information should be retrieved, and a symbol that specifies the database-entry. The current value of the database entry will be returned or {{#f}}, if no such entry is available. The setter procedure is called with three arguments: the symbol and key and the new value. The pass iteration count currently is meaningful only for the 'opt pass. The analysis continuation flag will be {{#f}} for the last 'opt pass. For information about the contents of the program database contact the author.
    375379
    376380Loaded code (via the {{-extend}} option) has access to the library
     
    382386seen by {{user-preprocessor-pass}} but by {{user-pass}}.
    383387
    384 == Distributing compiled C files
     388=== Distributing compiled C files
    385389
    386390It is relatively easy to create distributions of Scheme projects that
     
    432436the optimal stack-size and selecting supported features of the host system would need
    433437more configuration- and build-time support. All this can be addressed using more
    434 elaborate build-scripts, makefiles or by using [[autoconf - automake]].
     438elaborate build-scripts, makefiles or by using autoconf/automake.
    435439
    436440Note also that the size of the application can still be reduced by removing {{extras}} and
    437441{{eval}} and compiling {{hello.scm}} with the {{-explicit-use}} option.
    438442
    439 For more information, study the CHICKEN source code
    440 and/or get in contact with the author.
     443For more information, study the CHICKEN source code and/or get in
     444contact with the author.
    441445
    442446Previous: [[The User's Manual]]
  • chicken/trunk/manual/Using the interpreter

    r5220 r5393  
    212212history (over different {{csi}} sessions) and a more feature-full
    213213editor for the expressions you type
    214 using the [[readline]] egg by
     214using the [[http://www.call-with-current-continuation.org/eggs/readline.html]] egg by
    215215Tony Garnock Jones.
    216216It is very useful for interactive use of csi.
     
    222222 (gnu-history-install-file-manager (string-append (or (getenv "HOME") ".") "/.csi.history"))
    223223
    224 More details are available in [[readline|the egg's documentation]].
     224More details are available in [[http://www.call-with-current-continuation.org/eggs/readline.html|the egg's documentation]].
    225225
    226226=== Accessing documentation
    227227
    228 You can access the manual directly from {{csi}} using the [[man]] extension by [[Mario Domenech Goulart]].
     228You can access the manual directly from {{csi}} using the [[http://www.call-with-current-continuation.org/eggs/man.html|man]] extension by Mario Domenech Goulart.
    229229
    230230To enable it install the egg and put this in your {{~/.csirc}} file:
  • chicken/trunk/manual/chicken-setup

    r5220 r5393  
    346346
    347347;; compile the code into a dynamically loadable shared object
    348 ;; (will generate hello.so or hello.dll on Windows)
     348;; (will generate hello.so)
    349349(compile -s hello.scm)
    350350
     
    352352(install-extension 'hello "hello.so")
    353353</enscript>
    354 
    355 (Note: {{install-extension}} will recognized the {{.so}} extension and automatically
    356 do the right thing on Windows)
    357354
    358355After entering
  • chicken/trunk/manual/faq

    r5220 r5393  
    22[[tags:faq]]
    33
    4 == Introduction
     4== FAQ
    55
    66This is the list of Frequently Asked Questions about Chicken Scheme.
     
    88if you consider your question general enough, feel free to add it to this list.
    99
    10 == General
    11 
    12 === Why yet another Scheme implementation?
     10=== General
     11
     12==== Why yet another Scheme implementation?
    1313
    1414Since Scheme is a relatively simple language, a large number of implementations exist and
     
    2727* As far as we know, CHICKEN is the first implementation of Scheme that uses Henry Baker's [[http://home.pipeline.com/~hbaker1/CheneyMTA.html|Cheney on the M.T.A]] concept.
    2828
    29 === What should I do if I find a bug?
     29==== What should I do if I find a bug?
    3030
    3131Send e-mail to felix@call-with-current-continuation.org
     
    3434causes the bug, etc.
    3535
    36 === Why are values defined with {{define-foreign-variable}} or {{define-constant}} or {{define-inline}} not seen outside of the containing source file?
     36==== Why are values defined with {{define-foreign-variable}} or {{define-constant}} or {{define-inline}} not seen outside of the containing source file?
    3737
    3838Accesses to foreign variables are translated directly into C constructs that access the variable,
     
    4141that this reference is to be replaced with the actual value.
    4242
    43 === How does {{cond-expand}} know which features are registered in used units?
     43==== How does {{cond-expand}} know which features are registered in used units?
    4444
    4545Each unit used via {{(declare (uses ...))}} is registered as a feature and
     
    4949to register features at compile time.
    5050
    51 === Why are constants defined by {{define-constant}} not honoured in {{case}} constructs?
     51==== Why are constants defined by {{define-constant}} not honoured in {{case}} constructs?
    5252
    5353{{case}} expands into a cascaded {{if}} expression, where the first item in each arm
     
    5757
    5858
    59 === How can I enable case sensitive reading/writing in user code?
     59==== How can I enable case sensitive reading/writing in user code?
    6060
    6161To enable the {{read}} procedure to read symbols and identifiers case sensitive, you can set the
     
    6363
    6464
    65 === How can I change {{match-error-control}} during compilation?
     65==== How can I change {{match-error-control}} during compilation?
    6666
    6767Use {{eval-when}}, like this:
     
    7373
    7474
    75 === Why doesn't CHICKEN support the full numeric tower by default?
     75==== Why doesn't CHICKEN support the full numeric tower by default?
    7676
    7777The short answer:
     
    9898
    9999
    100 === How can I specialize a generic function method to match instances of every class?
     100==== How can I specialize a generic function method to match instances of every class?
    101101
    102102Specializing a method on {{<object>}} doesn't work on primitive data objects like
     
    117117
    118118
    119 === Does CHICKEN support native threads?
     119==== Does CHICKEN support native threads?
    120120
    121121Currently native threads are not supported. The runtime system is not reentrant, and the garbage-collection
     
    125125
    126126
    127 == Platform specific
    128 
    129 === How do I generate a DLL under MS Windows (tm) ?
     127=== Platform specific
     128
     129==== How do I generate a DLL under MS Windows (tm) ?
    130130
    131131Use {{csc}} in combination with the {{-dll}} option:
     
    133133{{C:\> csc foo.scm -dll}}
    134134
    135 === How do I generate a GUI application under Windows(tm)?
     135==== How do I generate a GUI application under Windows(tm)?
    136136
    137137Invoke {{csc}} with the {{-windows}} option. Or pass the {{-DC_WINDOWS_GUI}}
     
    140140parsing.
    141141
    142 === Compiling very large files under Windows with the Microsoft C compiler fails with a message indicating insufficient heap space.
     142==== Compiling very large files under Windows with the Microsoft C compiler fails with a message indicating insufficient heap space.
    143143
    144144It seems that the Microsoft C compiler can only handle files up to a certain size, and it doesn't utilize virtual memory as
     
    146146into several library units.
    147147
    148 === When I run {{csi}} inside an emacs buffer under Windows, nothing happens.
     148==== When I run {{csi}} inside an emacs buffer under Windows, nothing happens.
    149149
    150150Invoke {{csi}} with the {{-:c}} runtime option. Under Windows the interpreter thinks it
    151151is not running under control of a terminal and doesn't print the prompt and does not flush the output stream properly.
    152152
    153 === I load compiled code dynamically in a Windows GUI application and it crashes.
     153==== I load compiled code dynamically in a Windows GUI application and it crashes.
    154154
    155155Code compiled into a DLL to be loaded dynamically must be linked with the same runtime system as the loading
     
    157157{{chicken-setup}}) must be compiled with the {{-windows}} {{csc}} option.
    158158
    159 === On Windows, {{csc.exe}} seems to be doing something wrong.
     159==== On Windows, {{csc.exe}} seems to be doing something wrong.
    160160
    161161The Windows development tools include a C# compiler with the same name. Either invoke {{csc.exe}} with a full
     
    163163environment variable.
    164164
    165 === On Windows source and/or output filenames with embedded whitespace are not found.
     165==== On Windows source and/or output filenames with embedded whitespace are not found.
    166166
    167167There is no current workaround. Do not use filenames with embedded whitespace for code. However, command
    168168names with embedded whitespace will work correctly.
    169 == Customization
    170 
    171 
    172 === How do I run custom startup code before the runtime-system is invoked?
     169=== Customization
     170
     171
     172==== How do I run custom startup code before the runtime-system is invoked?
    173173
    174174When you invoke the C compiler for your translated Scheme source program, add the C compiler option
     
    189189</enscript>
    190190
    191 === How can I add compiled user passes?
     191==== How can I add compiled user passes?
    192192
    193193To add a compiled user pass instead of an interpreted one, create a library unit and recompile
     
    222222
    223223
    224 == Compiled macros
    225 
    226 === Why is {{define-macro}} complaining about unbound variables?
     224=== Compiled macros
     225
     226==== Why is {{define-macro}} complaining about unbound variables?
    227227
    228228Macro bodies that are defined and used in a compiled source-file are
    229229evaluated during compilation and so have no access to anything created with {{define}}. Use {{define-for-syntax}} instead.
    230230
    231 === Why isn't {{load}} properly loading my library of macros?
     231==== Why isn't {{load}} properly loading my library of macros?
    232232
    233233During compile-time, macros are only available in the source file in which they are defined. Files included via {{include}} are considered part of the containing file.
    234234
    235 === Why is {{include}} unable to load my hygienic macros?
     235==== Why is {{include}} unable to load my hygienic macros?
    236236
    237237It is not sufficient for the included file to require the {{syntax-case}} extension. Call {{(require-extension syntax-case)}} ''before'' calling {{include}}.
    238238
    239 === Why are macros not visible outside of the compilation unit in which they are defined?
     239==== Why are macros not visible outside of the compilation unit in which they are defined?
    240240
    241241Macros are defined during compile time, so when a file has been compiled, the definitions are gone. An exception
     
    244244form.
    245245
    246 == Warnings and errors
    247 
    248 === Why does my program crash when I use callback functions (from Scheme to C and back to Scheme again)?
     246=== Warnings and errors
     247
     248==== Why does my program crash when I use callback functions (from Scheme to C and back to Scheme again)?
    249249
    250250There are two reasons why code involving callbacks can crash out of no apparent reason:
     
    254254# If the C code uses a large amount of stack storage, or if Scheme-to-C-to-Scheme calls are nested deeply, then the available nursery space on the stack will run low. To avoid this it might be advisable to run the compiled code with a larger nursery setting, i.e. run the code with {{-:s...}} and a larger value than the default (for example {{-:s300k}}), or use the {{-nursery}} compiler option.  Note that this can decrease runtime performance on some platforms.
    255255
    256 === Why does the linker complain about a missing function {{_C_..._toplevel}}?
     256==== Why does the linker complain about a missing function {{_C_..._toplevel}}?
    257257
    258258This message indicates that your program uses a library-unit, but that the
     
    263263{{% csc program.scm foo.o -o program}}
    264264
    265 === Why does the linker complain about a missing function {{_C_toplevel}}?
     265==== Why does the linker complain about a missing function {{_C_toplevel}}?
    266266
    267267This means you have compiled a library unit as an application. When a unit-declaration (as in {{(declare (unit ...))}})
     
    269269or compile this file to an object-module and link it to your application code.
    270270
    271 === Why does my program crash when I compile a file with {{-unsafe}} or unsafe declarations?
     271==== Why does my program crash when I compile a file with {{-unsafe}} or unsafe declarations?
    272272
    273273The compiler option {{-unsafe}} or the declaration {{(declare (unsafe))}} disable
     
    277277declarations) and use this feature only if the application works properly.
    278278
    279 === Why do I get a warning when I define a global variable named {{match}}?
     279==== Why do I get a warning when I define a global variable named {{match}}?
    280280
    281281Even when the {{match}} unit is not used, the macros from that package are visible in the compiler.
     
    291291(eval-when (compile eval) (undefine-macro! 'match))
    292292</enscript>
    293 === Why don't toplevel-continuations captured in interpreted code work?
     293==== Why don't toplevel-continuations captured in interpreted code work?
    294294
    295295Consider the following piece of code:
     
    309309expressions will be loaded together.
    310310
    311 === Why does {{define-reader-ctor}} not work in my compiled program?
     311==== Why does {{define-reader-ctor}} not work in my compiled program?
    312312
    313313The following piece of code does not work as expected:
     
    335335</enscript>
    336336
    337 === Why do built-in units, such as srfi-1, srfi-18, and posix fail to load?
     337==== Why do built-in units, such as srfi-1, srfi-18, and posix fail to load?
    338338
    339339When you try to {{use}} a built-in unit such as {{srfi-18}}, you may get the following error:
     
    355355 export LD_LIBRARY_PATH=~/scheme/chicken/lib:$LD_LIBRARY_PATH    ;; Linux
    356356
    357 === How can I increase the size of the trace shown when runtime errors are detected?
     357==== How can I increase the size of the trace shown when runtime errors are detected?
    358358
    359359When a runtime error is detected, Chicken will print the last entries from the trace of functions called
     
    362362To increase this number pass the {{-:aN}} parameter to your executable.
    363363
    364 == Optimizations
    365 
    366 === How can I obtain smaller executables?
     364=== Optimizations
     365
     366==== How can I obtain smaller executables?
    367367
    368368If you don't need {{eval}} or the stuff in the {{extras}} library unit,
     
    379379a program would have to implement quite a lot of support code on its own.
    380380
    381 === How can I obtain faster executables?
     381==== How can I obtain faster executables?
    382382
    383383There are a number of declaration specifiers that should be used to speed up
     
    405405option or by using the {{-:s...}} runtime option).
    406406
    407 === Which non-standard procedures are treated specially when the {{extended-bindings}} or {{usual-integrations}} declaration or compiler option is used?
     407==== Which non-standard procedures are treated specially when the {{extended-bindings}} or {{usual-integrations}} declaration or compiler option is used?
    408408
    409409The following standard bindings are handled specially, depending on optimization options
    410410and compiler settings:
    411411
    412  + * - / quotient eq? eqv? equal? apply c...r values call-with-values
    413  list-ref null? length not char? string? symbol? vector? pair? procedure?
    414  boolean? number? complex? rational? real? exact? inexact? list? eof-object?
    415  string-ref string-set! vector-ref vector-set! char=? char<? char>? char<=? char>=?
    416  char-numeric? char-alphabetic? char-whitespace? char-upper-case?
    417  char-lower-case? char-upcae char-downcase list-tail assv memv memq assoc
    418  member set-car! set-cdr! abs exp sin cos tan log asin acos atan sqrt
    419  zero? positive? negative? vector-length string-length char->integer
    420  integer->char inexact->exact = > < >= <= for-each map substring
    421  string-append gcd lcm list exact->inexact string->number number->string
    422  even? odd? remainder floor ceiling truncate round cons vector string
    423  string=? string-ci=? make-vector call-with-current-continuation
     412 {{+}} {{*}} {{-}} {{/}} {{quotient}} {{eq?}} {{eqv?}} {{equal?}} {{apply}} {{c...r}} {{values}} {{call-with-values}}
     413 {{list-ref}} {{null?}} {{length}} {{not}} {{char?}} {{string?}} {{symbol?}} {{vector?}} {{pair?}} {{procedure?}}
     414 {{boolean?}} {{number?}} {{complex?}} {{rational?}} {{real?}} {{exact?}} {{inexact?}} {{list?}} {{eof-object?}}
     415 {{string-ref}} {{string-set!}} {{vector-ref}} {{vector-set!}} {{char=?}} {{char<?}} {{char>?}} {{char<=?}} {{char>=?}}
     416 {{char-numeric?}} {{char-alphabetic?}} {{char-whitespace?}} {{char-upper-case?}}
     417 {{char-lower-case?}} {{char-upcae}} {{char-downcase}} {{list-tail}} {{assv}} {{memv}} {{memq}} {{assoc}}
     418 {{member}} {{set-car!}} {{set-cdr!}} {{abs}} {{exp}} {{sin}} {{cos}} {{tan}} {{log}} {{asin}} {{acos}} {{atan}} {{sqrt}}
     419 {{zero?}} {{positive?}} {{negative?}} {{vector-length}} {{string-length}} {{char->integer}}
     420 {{integer->char}} {{inexact->exact}} {{=}} {{>}} {{<}} {{>=}} {{<=}} {{for-each}} {{map}} {{substring}}
     421 {{string-append}} {{gcd}} {{lcm}} {{list}} {{exact->inexact}} {{string->number}} {{number->string}}
     422 {{even?}} {{odd?}} {{remainder}} {{floor}} {{ceiling}} {{truncate}} {{round}} {{cons}} {{vector}} {{string}}
     423 {{string=?}} {{string-ci=?}} {{make-vector}} {{call-with-current-continuation}}
     424 {{write-char}} {{read-string}}
    424425
    425426The following extended bindings are handled specially:
     
    468469{{locative-ref}} {{locative-set!}} {{locative?}} {{locative->object}} {{identity}}
    469470{{cpu-time}} {{error}} {{call/cc}} {{any?}}
    470 
    471 === Can I load compiled code at runtime?
     471{{substring=?}} {{substring-ci=?}} {{substring-index}} {{substring-index-ci}}
     472
     473==== Can I load compiled code at runtime?
    472474
    473475Yes.
     
    481483which point {{foo.scm}} will no longer be required).
    482484
    483 == Garbage collection
    484 
    485 === Why does a loop that doesn't {{cons}} still trigger garbage collections?
     485=== Garbage collection
     486
     487==== Why does a loop that doesn't {{cons}} still trigger garbage collections?
    486488
    487489Under CHICKENs implementation policy, tail recursion is achieved simply by avoiding to
     
    497499live data after it invokes its continuation - and so the amount of heap-space needed stays constant)
    498500
    499 === Why do finalizers not seem to work in simple cases in the interpeter?
     501==== Why do finalizers not seem to work in simple cases in the interpeter?
    500502
    501503Consider the following interaction in CSI:
     
    523525and wrap calls to {{set-finalizer!}} in it.
    524526
    525 == Interpreter
    526 
    527 === Does CSI support history and autocompletion?
    528 
    529 CSI doesn't support it natively but it can be activated with the [[readline]] egg.
     527=== Interpreter
     528
     529==== Does CSI support history and autocompletion?
     530
     531CSI doesn't support it natively but it can be activated with the [[http://www.call-with-current-continuation.org/eggs/readline.html]] egg.
    530532After installing the egg, add the following to your {{~/.csirc}} or equivalent file:
    531533
     
    539541Users of *nix-like systems (including Cygwin), may also want to check out [[http://utopia.knoware.nl/~hlub/rlwrap/|rlwrap]].  This program lets you "wrap" another process (e.g. {{rlwrap csi}}) with the readline library, giving you history, autocompletion, and the ability to set the keystroke set. Vi fans can get vi keystrokes by adding "set editing-mode vi" to their {{.inputrc}} file.
    540542
    541 === Does code loaded with {{load}} run compiled or interpreted?
     543==== Does code loaded with {{load}} run compiled or interpreted?
    542544
    543545If you compile a file with a call to {{load}}, the code will be loaded at
     
    546548interpreted (even if the caller program is compiled).
    547549
    548 == Extensions ==
    549 
    550 === How can I install Chicken eggs to a non-default location?
     550=== Extensions
     551
     552==== How can I install Chicken eggs to a non-default location?
    551553
    552554You can just set the {{CHICKEN_REPOSITORY}} environment variable.
     
    566568Note, however, that using {{repository-path}} as above hard-codes the location of your eggs in your source files.  While this might not be an issue in your case, it might be safe to keep this configuration outside of the source code (that is, specifying it as an environment variable) to make it easier to maintain.
    567569
    568 === Can I install chicken eggs as a non-root user?
    569 
    570 Yes, just [[#How can I install Chicken eggs to a non-default location?|install them in a directory you can write]].
     570==== Can I install chicken eggs as a non-root user?
     571
     572Yes, just [[FAQ#Extensions#How can I install Chicken eggs to a non-default location?|install them in a directory you can write]].
    571573
    572574----
  • chicken/trunk/site/index.html

    r5362 r5393  
    151151
    152152Snapshots of the current development version can be found here:
    153 <a href="http://chicken.wiki.br/dev-snapshots/">http://chicken.wiki.br/dev-snapshots/</a>
     153<a href="http://chicken.wiki.br/dev-snapshots/current">http://chicken.wiki.br/dev-snapshots/current</a>
    154154
    155155</p>
Note: See TracChangeset for help on using the changeset viewer.