Changeset 30951 in project


Ignore:
Timestamp:
06/02/14 19:17:06 (6 years ago)
Author:
sjamaan
Message:

Update the online User's Manual for CHICKEN 4.9.0

Location:
wiki/man/4
Files:
23 edited

Legend:

Unmodified
Added
Removed
  • wiki/man/4/Accessing external objects

    r30225 r30951  
    152152
    153153This is similar to {{foreign-lambda}}, but also allows the called
    154 function to call Scheme functions and allocate Scheme data-objects. See [[Callbacks]].
     154function to call Scheme functions. See [[Callbacks]].
    155155
    156156
  • wiki/man/4/Acknowledgements

    r26854 r30951  
    44
    55Many thanks to Jules Altfas, Nico Amtsberg, Alonso Andres, William
    6 Annis, Marc Baily, Peter Barabas, Jonah Beckford, Arto Bendiken, Kevin
    7 Beranek, Peter Bex, Jean-Francois Bignolles, Oivind Binde, Alaric
    8 Blagrave-Snellpym, Dave Bodenstab, Fabian Böhlke, T. Kurt Bond,
    9 Ashley Bone, Dominique Boucher, Terence Brannon, Roy Bryant, Adam
    10 Buchbinder, Hans Bulfone, "Category 5", Taylor Campbell, Naruto
    11 Canada, Mark Carter, Esteban U. Caamano Castro, Semih Cemiloglu,
    12 Franklin Chen, Joo ChurlSoo, Thomas Chust, Gian Paolo Ciceri, Fulvio
    13 Ciriaco, Paul Colby, Tobia Conforto, John Cowan, Grzegorz Chrupala,
    14 James Crippen, Tollef Fog Heen, Drew Hess, Alejandro Forero Cuervo,
     6Annis, Jason E. Aten, Marc Baily, Peter Barabas, Andrei Barbu, Jonah
     7Beckford, Arto Bendiken, Kevin Beranek, Peter Bex, Jean-Francois
     8Bignolles, Oivind Binde, Alaric Blagrave-Snellpym, Dave Bodenstab,
     9Fabian Böhlke, T. Kurt Bond, Ashley Bone, Dominique Boucher, Terence
     10Brannon, Roy Bryant, Adam Buchbinder, Hans Bulfone, "Category 5",
     11Taylor Campbell, Naruto Canada, Mark Carter, Esteban U. Caamano
     12Castro, Semih Cemiloglu, Franklin Chen, Joo ChurlSoo, Thomas Chust,
     13Gian Paolo Ciceri, Fulvio Ciriaco, Paul Colby, Tobia Conforto, John
     14Cowan, Grzegorz Chrupala, James Crippen, Evan Hanson, Adhi Hargo,
     15Moritz Heidkamp, Tollef Fog Heen, Drew Hess, Alejandro Forero Cuervo,
    1516Peter Danenberg, Linh Dang, Brian Denheyer, Sean D'Epagnier, "dgym",
    1617"Don", Chris Double, "Brown Dragon", David Dreisigmeyer, Jarod Eells,
    17 Petter Egesund, Stephen Eilert, Steve Elkins, Daniel B. Faken, Will
    18 Farr, Graham Fawcett, Marc Feeley, "Fizzie", Matthew Flatt, Kimura
    19 Fuyuki, Tony Garnock-Jones, Martin Gasbichler, Abdulaziz Ghuloum, Joey
    20 Gibson, Stephen C. Gilardi, Mario Domenech Goulart, Joshua Griffith,
    21 Johannes Groedem, Damian Gryski, Andreas Gustafsson, Sven Hartrumpf,
    22 Jun-ichiro itojun Hagino, Evan Hanson, Adhi Hargo, Moritz Heidkamp, Matthias Heiler, Karl
    23 M. Hegbloom, William P. Heinemann, Bill Hoffman, Bruce Hoult, Hans
    24 HÃŒbner, Markus HÃŒlsmann, Götz Isenmann, Paulo Jabardo, Wietse
    25 Jacobs, David Janssens, Christian JÀger, Matt Jones, Dale Jordan,
    26 Valentin Kamyshenko, Daishi Kato, Peter Keller, Christian Kellermann, Brad Kind, Ron
    27 Kneusel, Matthias Köppe, Krysztof Kowalczyk, Andre KÃŒhne, Todd
    28 R. Kueny Sr, Goran Krampe, David Krentzlin, Ben Kurtz, Micky
    29 Latowicki, John Lenz, Kirill Lisovsky, JÃŒrgen Lorenz, Kon Lovett, Lam
    30 Luu, Vitaly Magerya, Leonardo Valeri Manera, Claude Marinier, Dennis
    31 Marti, Charles Martin, Bob McIsaac, "megane", Alain Mellan, Eric
    32 Merrit, Perry Metzger, Scott G. Miller, Mikael, Karel Miklav, Bruce
    33 Mitchener, Fadi Moukayed, Chris Moline, Eric E. Moore, Julian
    34 Morrison, Dan Muresan, David N. Murray, Timo MyyrÀ, "nicktick", Lars Nilsson, Ian
    35 Oversby, "o.t.", Gene Pavlovsky, Levi Pearson, Jeronimo Pellegrini,
    36 Nicolas Pelletier, Derrell Piper, Carlos Pita, Robin Lee Powell, Alan
    37 Post, "Pupeno", Davide Puricelli, "presto", Doug Quale, Imran Rafique,
    38 Eric Raible, Ivan Raikov, Joel Reymont, Chris Roberts, Eric Rochester,
    39 Paul Romanchenko, Andreas Rottman, David Rush, Lars Rustemeier, Daniel
    40 Sadilek, "Sandro", Oskar Schirmer, Burton Samograd, Aleksej Saushev,
    41 Reed Sheridan, Ronald Schroeder, Spencer Schumann, Ivan Shcheklein,
    42 Alex Shinn, Ivan Shmakov, "Shmul", Tony Sidaway, Jeffrey B. Siegal,
    43 Andrey Sidorenko, Michele Simionato, Iruata Souza, Volker Stolz, Jon
    44 Strait, Dorai Sitaram, Robert Skeels, Jason Songhurst, Clifford Stein,
    45 David Steiner, Sunnan, Zbigniew Szadkowski, Rick Taube, Nathan Thern,
    46 Mike Thomas, Minh Thu, Christian Tismer, Andre van Tonder, John Tobey,
    47 Henrik Tramberend, Vladimir Tsichevsky, James Ursetto, Neil van Dyke, Sam Varner,
    48 Taylor Venable, Sander Vesik, Jaques Vidrine, Panagiotis Vossos, Shawn
    49 Wagner, Peter Wang, Ed Watkeys, Brad Watson, Thomas Weidner, Goeran
    50 Weinholt, Matthew Welland, Drake Wilson, Joerg Wittenberger, Peter
    51 Wright, Mark Wutka, Richard Zidlicky and Houman Zolfaghari for
     18Petter Egesund, Stephen Eilert, Steve Elkins, Daniel B. Faken, Erik
     19Falor, Will Farr, Graham Fawcett, Marc Feeley, "Fizzie", Matthew
     20Flatt, Kimura Fuyuki, Tony Garnock-Jones, Martin Gasbichler, Abdulaziz
     21Ghuloum, Joey Gibson, Stephen C. Gilardi, Mario Domenech Goulart,
     22Joshua Griffith, Johannes Groedem, Damian Gryski, Matt Gushee, Andreas
     23Gustafsson, Sven Hartrumpf, Jun-ichiro itojun Hagino, Ahdi Hargo,
     24Matthias Heiler, Karl M. Hegbloom, William P. Heinemann, Bill Hoffman,
     25Bruce Hoult, Hans HÃŒbner, Markus HÃŒlsmann, Götz Isenmann, Paulo
     26Jabardo, Wietse Jacobs, David Janssens, Christian JÀger, Matt Jones,
     27Dale Jordan, Valentin Kamyshenko, Daishi Kato, Peter Keller, Christian
     28Kellermann, Brad Kind, Ron Kneusel, Matthias Köppe, Krysztof
     29Kowalczyk, Andre KÃŒhne, Todd R. Kueny Sr, Goran Krampe, David
     30Krentzlin, Ben Kurtz, Michele La Monaca, Micky Latowicki, Kristian
     31Lein-Mathisen, John Lenz, Kirill Lisovsky, JÃŒrgen Lorenz, Kon Lovett,
     32Lam Luu, Vitaly Magerya, Leonardo Valeri Manera, Claude Marinier,
     33Dennis Marti, Charles Martin, Bob McIsaac, "megane", Alain Mellan,
     34Eric Merrit, Perry Metzger, Scott G. Miller, Mikael, Karel Miklav,
     35Bruce Mitchener, Fadi Moukayed, Chris Moline, Eric E. Moore, Julian
     36Morrison, Dan Muresan, David N. Murray, Timo MyyrÀ, "nicktick", Lars
     37Nilsson, Ian Oversby, "o.t.", Gene Pavlovsky, Levi Pearson, Jeronimo
     38Pellegrini, Nicolas Pelletier, Derrell Piper, Carlos Pita, "Pluijzer",
     39Robin Lee Powell, Alan Post, "Pupeno", Davide Puricelli, "presto",
     40Doug Quale, Imran Rafique, Eric Raible, Ivan Raikov, Santosh Rajan,
     41Joel Reymont, "rivo", Chris Roberts, Eric Rochester, Paul Romanchenko,
     42Andreas Rottman, David Rush, Lars Rustemeier, Daniel Sadilek, Otavio
     43Salvador, Burton Samograd, "Sandro", "satori", Aleksej Saushev, Oskar
     44Schirmer, Reed Sheridan, Ronald Schröder, Spencer Schumann, Ivan
     45Shcheklein, Alex Shinn, Ivan Shmakov, "Shmul", Tony Sidaway, Jeffrey
     46B. Siegal, Andrey Sidorenko, Michele Simionato, Iruata Souza, Volker
     47Stolz, Jon Strait, Dorai Sitaram, Robert Skeels, Jason Songhurst,
     48Clifford Stein, David Steiner, Sunnan, Zbigniew Szadkowski, Rick
     49Taube, Nathan Thern, Mike Thomas, Minh Thu, Christian Tismer, Andre
     50van Tonder, John Tobey, Henrik Tramberend, Vladimir Tsichevsky, James
     51Ursetto, Neil van Dyke, Sam Varner, Taylor Venable, Sander Vesik,
     52Jaques Vidrine, Panagiotis Vossos, Shawn Wagner, Peter Wang, Ed
     53Watkeys, Brad Watson, Thomas Weidner, Göran Weinholt, Matthew Welland,
     54Drake Wilson, Jörg Wittenberger, Peter Wright, Mark Wutka, Adam Young,
     55Richard Zidlicky, Houman Zolfaghari and Florian Zumbiehl for
    5256bug-fixes, tips and suggestions.
    53 
    54 CHICKEN uses the "irregex" regular expression package written by Alex Shinn.
    5557
    5658Special thanks to Brandon van Every for contributing the (now defunct)
    5759[[http://www.cmake.org|CMake]] support and for helping with Windows
    5860build issues.
     61
     62Thanks to [[http://www.bevuta.com|bevuta IT GmbH]] for providing serverspace
     63and contributing patches and support.
    5964
    6065Also special thanks to Benedikt Rosenau for his constant encouragement.
     
    6570CHICKEN contains code from several people:
    6671
     72; Marc Feeley : pretty-printer.
    6773; Richard Kelsey, Jonathan Rees and Taylor Campbell : {{syntax-rules}} expander
    6874; Mikael Djurfeldt : topological sort used by compiler.
    69 ; Marc Feeley : pretty-printer.
    7075; Aubrey Jaffer : implementation of {{dynamic-wind}}.
    7176; Richard O'Keefe : sorting routines.
     77; Alex Shinn : the [[http://synthcode.com/scheme/irregex/|irregex]] regular expression package.
    7278; Olin Shivers : implementation of {{let-optionals[*]}} and reference implementations of SRFI-1, SRFI-13 and SRFI-14.
    7379; Andrew Wilcox : queues.
  • wiki/man/4/Data representation

    r30824 r30951  
    4444single machine word.
    4545
    46 The 24 (56 on 64-bit systems) lowest-order bits contain the length of the data object, which is either the number of bytes in a string or byte-vector, or the number of elements for a vector or record type. This allows a maximum size for string or byte-vectors of 2^24 bytes, or approximately 16 MB, on 32-bit systems, and 2^56 bytes, or approximately 72 PB, on 64-bit systems.
     46The 24 lowest-order bits contain the length of the data object, which
     47is either the number of bytes in a string or byte-vector, or the
     48number of elements for a vector or record type.
    4749
    4850The remaining bits are placed in the high-order end of the header.
  • wiki/man/4/Deployment

    r27884 r30951  
    165165
    166166Setting up the application executable to load runtime libraries from
    167 the same directory is supported on FreeBSD, OpenBSD and Solaris.
    168 NetBSD supports this from version 5.0 onwards - this is currently
    169 disabled in {{csc}} for this particular platform.
     167the same directory is supported on FreeBSD, NetBSD, OpenBSD and Solaris.
     168
     169Under NetBSD, you must invoke the binary using its full absolute path
     170(or via {{$PATH}}), otherwise it will give you an error message:
     171
     172  execname not specified in AUX vector: No such file or directory
     173
     174On AIX, deployment is currently not fully supported as the runtime
     175linker will only load libraries from paths hardcoded at link time.
    170176
    171177=== Deploying source code
  • wiki/man/4/Embedding

    r25875 r30951  
    4141is returned, otherwise this function returns {{0}}.
    4242
     43It is essential to run {{CHICKEN_initialize}} and subsequent calls to
     44{{CHICKEN_run}} in the same native thread. The former computes a stack
     45limit address which will not be valid if the runtime system is
     46re-entered in a execution context where the stack is located at a
     47different address.
     48
    4349=== CHICKEN_run
    4450
     
    5561the toplevel procedure, which just uses the default library units.
    5662
    57 
    5863Once {{CHICKEN_run}} has been called, Scheme code is executing until all toplevel
    5964expressions have been evaluated or until {{return-to-host}} is called inside the
  • wiki/man/4/Exceptions

    r28151 r30951  
    8383if the optional argument is given, no error is signaled and the accessor
    8484returns the third argument.
     85
     86* On platforms that support the {{sigprocmask(3)}} POSIX API function,
     87the signals {{SIGSEGV}}, {{SIGFPE}}, {{SIGBUS}} and {{SIGILL}} will be
     88caught and trigger an exception instead of aborting the process, if
     89possible. If the unwinding and handling of the signal raises one of
     90these signals once again, the process will abort with an error
     91message.
    8592
    8693=== Additional API
  • wiki/man/4/Extensions

    r27801 r30951  
    172172   'ID
    173173   '("ID.so" "ID.import.so")
    174    '((version VERSION)
     174   '((version 0.1)
    175175     ... `INFO' ...
    176176     ))
     
    577577; {{-x   -keep-installed}} : ignore those extensions given on the command line, that are already installed
    578578; {{-reinstall}} : reinstall all currently installed extensions, keeping the current versions, if possible
    579 ; {{-scan DIRECTORY}} : scan local egg source repository or highest available versions
     579; {{-scan DIRECTORY}} : scan local egg source repository for highest available versions
    580580; {{-override FILENAME}} : override versions for installed eggs with information given in {{FILENAME}}, which can be generated by {{-scan}} or by the {{-list}} option of the {{chicken-status}} program
    581581; {{-csi FILENAME}} : when invoking {{csi}}, the CHICKEN interpreter for executing installation scripts, use this program instead.
  • wiki/man/4/Getting started

    r28626 r30951  
    157157current version of the User's manual, along with various tutorials and
    158158other useful documents. The list of eggs is at
    159 [[http://wiki.call-cc.org/egg-index]].
     159[[/egg-index]].
    160160
    161161A very useful search facility for questions about CHICKEN is found at
     
    274274improved version of the vi editor distributed with most UNIX
    275275systems. Vim comes with generic Lisp (and therefore Scheme) editing
    276 capabilities out of the box. See [[/Vim]] for a few tips on using
    277 Vim with CHICKEN.
     276capabilities out of the box. See [[/Vim]]
     277for a few tips on using Vim with CHICKEN.
    278278
    279279In the rest of this chapter, we'll assume that you are using an editor
  • wiki/man/4/Modules

    r29562 r30951  
    385385must be available separately.
    386386
     387
    387388=== Functors
    388389
     
    400401
    401402This defines a generic "squaring" operation that uses {{multiply}}, a
    402 procedure (or syntax) exported by the as-yet-unknown module {{M}}. Now
     403procedure (or macro!) exported by the as-yet-unknown module {{M}}. Now
    403404let's instantiate the functor for a specific input module:
    404405
     
    441442The general syntax of a functor definition looks like this:
    442443
    443 <enscript highlight=scheme>
    444 (functor (FUNCTORNAME (ARGUMENTMODULE1 EXPORTS1) ...)
    445   FUNCTOREXPORTS
    446   BODY)
    447 </enscript>
     444<syntax>(functor (FUNCTORNAME (ARGUMENTMODULE1 EXPORTS1) ...) FUNCTOREXPORTS BODY)</syntax>
     445
     446Defines a "functor", a parameterized module.
    448447
    449448This functor definition does not generate any code. This is done
  • wiki/man/4/Non-standard macros and special forms

    r30461 r30951  
    4444* {{(version ID NUMBER)}} is equivalent to {{ID}}, but checks at compile-time whether the extension named {{ID}} is installed and whether its version is equal or higher than {{NUMBER}}. {{NUMBER}} may be a string or a number, the comparison is done lexicographically (using {{string>=?}}).
    4545
    46 See also: {{set-extension-specifier!}}
    47 
    4846==== require-extension
    4947
     
    6260
    6361{{use}} is just a shorter alias for {{require-extension}}.
     62
     63==== require-extension-for-syntax
     64
     65<macro>(require-extension-for-syntax ID ...)</macro>
     66
     67An abbreviation for the idiom:
     68
     69<enscript highlight=scheme>
     70(begin-for-syntax (require-library ID ...))  ; load extension at expansion-time
     71(import-for-syntax ID ...)                   ; import extension for use in syntax-transformers
     72</enscript>
     73
     74
     75==== use-for-syntax
     76
     77<macro>(use-for-syntax ID ...)</macro>
     78
     79{{use}} is just a shorter alias for {{require-extension-for-syntax}} (which is quite a mouthful).
    6480
    6581
     
    156172result of the {{and-let*}} form. See also the documentation for
    157173[[http://srfi.schemers.org/srfi-2/srfi-2.html|SRFI-2]].
     174
     175==== letrec*
     176
     177<macro>(letrec* ((VARIABLE EXPRESSION) ...) BODY ...)</macro>
     178
     179Implements R6RS/R7RS {{letrec*}}. {{letrec*}} is similar to {{letrec}} but
     180binds the variables sequentially and is to {{letrec}} what {{let*}} is to {{let}}.
    158181
    159182==== rec
     
    519542[[http://srfi.schemers.org/srfi-0/srfi-0.html|SRFI-0]].
    520543
     544=== {{delay-force}}
     545
     546CHICKEN supports the R7RS {{delay-force}} syntax which allows for
     547iterative lazy algorithms to be expressed in bounded space.
     548
     549For more information regarding this behaviour, see the
     550[[http://srfi.schemers.org/srfi-45/srfi-45.html|SRFI-45]] rationale.
     551
    521552==== ensure
    522553
  • wiki/man/4/Parameters

    r27461 r30951  
    162162<parameter>(repl-prompt)</parameter>
    163163
    164 A procedure that should evaluate to a string that will be printed before reading 
    165 interactive input from the user in a read-eval-print loop. Defaults to 
     164A procedure that should evaluate to a string that will be printed before reading
     165interactive input from the user in a read-eval-print loop. Defaults to
    166166{{(lambda () "#;N> ")}}.
    167167
     
    176176abort the current computation and to restart the read-eval-print loop.
    177177
     178
     179=== recursive-hash-max-depth
     180
     181<parameter>(recursive-hash-max-depth)</parameter>
     182
     183The maximum structure depth to follow when computing a hash value. The default is {{4}}.
     184
     185
     186=== recursive-hash-max-length
     187
     188<parameter>(recursive-hash-max-depth)</parameter>
     189
     190The maximum vector length to follow when computing a hash value. The default is {{4}}.
     191
    178192----
    179193Previous: [[Declarations]] Next: [[Exceptions]]
  • wiki/man/4/The R5RS standard

    r27461 r30951  
    33''Revised^5 Report on the Algorithmic Language Scheme''.
    44[[toc:]]
    5 == Overview of Scheme
    6 == Lexical conventions
    7 == Basic concepts
     5
    86== Expressions
    97
     
    1311defined as macros. With the exception of quasiquote, whose macro
    1412definition is complex, the derived expressions are classified as
    15 library features. Suitable definitions are given in section 7.3.
     13library features.  The distinction which R5RS makes between primitive
     14and derived is unimportant and does not necessarily reflect how it's
     15implemented in CHICKEN itself.
    1616
    1717=== Primitive expression types
     
    2121<macro><variable></macro><br>
    2222
    23 An expression consisting of a variable (section 3.1) is a variable
    24 reference. The value of the variable reference is the value stored in
    25 the location to which the variable is bound. It is an error to
    26 reference an unbound variable.
     23An expression consisting of a variable is a variable reference. The
     24value of the variable reference is the value stored in the location to
     25which the variable is bound. It is an error to reference an unbound
     26variable.
    2727
    2828 (define x 28)
     
    3636
    3737(quote <datum>) evaluates to <datum>. <Datum> may be any external
    38 representation of a Scheme object (see section 3.3). This notation is
    39 used to include literal constants in Scheme code.
     38representation of a Scheme object. This notation is used to include
     39literal constants in Scheme code.
    4040
    4141 (quote a)                    ===>  a
     
    6363 #t                 ===>  #t
    6464
    65 As noted in section 3.4, it is an error to alter a constant (i.e. the
    66 value of a literal expression) using a mutation procedure like set-car!
    67 or string-set!.
     65It is an error to alter a constant (i.e. the value of a literal
     66expression) using a mutation procedure like set-car! or string-set!.
     67In the current implementation of CHICKEN, identical constants don't
     68share memory and it is possible to mutate them, but this may change in
     69the future.
    6870
    6971==== Procedure calls
     
    8284A number of procedures are available as the values of variables in the
    8385initial environment; for example, the addition and multiplication
    84 procedures in the above examples are the values of the variables + and *.
    85 New procedures are created by evaluating lambda expressions (see
    86 section 4.1.4). Procedure calls may return any number of values (see
    87 values in section 6.4). With the exception of values the procedures
    88 available in the initial environment return one value or, for
    89 procedures such as apply, pass on the values returned by a call to one
    90 of their arguments.
     86procedures in the above examples are the values of the variables + and
     87*.  New procedures are created by evaluating lambda
     88expressions. Procedure calls may return any number of values (see the
     89{{values}} procedure [[#control-features|below]]).
    9190
    9291Procedure calls are also called combinations.
     
    165164Each procedure created as the result of evaluating a lambda expression
    166165is (conceptually) tagged with a storage location, in order to make eqv?
    167 and eq? work on procedures (see section 6.1).
     166and eq? work on procedures.
    168167
    169168==== Conditionals
     
    176175
    177176Semantics: An if expression is evaluated as follows: first, <test> is
    178 evaluated. If it yields a true value (see section 6.3.1), then
    179 <consequent> is evaluated and its value(s) is(are) returned. Otherwise
    180 <alternate> is evaluated and its value(s) is(are) returned. If <test>
    181 yields a false value and no <alternate> is specified, then the result
    182 of the expression is unspecified.
     177evaluated. If it yields a true value (see [[#booleans|the section
     178about booleans]] below), then <consequent> is evaluated and its
     179value(s) is(are) returned. Otherwise <alternate> is evaluated and its
     180value(s) is(are) returned. If <test> yields a false value and no
     181<alternate> is specified, then the result of the expression is
     182unspecified.
    183183
    184184 (if (> 3 2) 'yes 'no)                   ===>  yes
     
    204204=== Derived expression types
    205205
    206 The constructs in this section are hygienic, as discussed in section
    207 4.3. For reference purposes, section 7.3 gives macro definitions that
    208 will convert most of the constructs described in this section into the
    209 primitive constructs described in the previous section.
     206The constructs in this section are hygienic.  For reference purposes,
     207these macro definitions will convert most of the constructs described
     208in this section into the primitive constructs described in the
     209previous section.  This does not necessarily mean that's exactly how
     210it's implemented in CHICKEN.
    210211
    211212==== Conditionals
     
    228229Semantics: A cond expression is evaluated by evaluating the <test>
    229230expressions of successive <clause>s in order until one of them
    230 evaluates to a true value (see section 6.3.1). When a <test> evaluates
    231 to a true value, then the remaining <expression>s in its <clause> are
    232 evaluated in order, and the result(s) of the last <expression> in the
    233 <clause> is(are) returned as the result(s) of the entire cond
    234 expression. If the selected <clause> contains only the <test> and no
    235 <expression>s, then the value of the <test> is returned as the result.
    236 If the selected <clause> uses the => alternate form, then the
    237 <expression> is evaluated. Its value must be a procedure that accepts
    238 one argument; this procedure is then called on the value of the <test>
    239 and the value(s) returned by this procedure is(are) returned by the
    240 cond expression. If all <test>s evaluate to false values, and there is
    241 no else clause, then the result of the conditional expression is
     231evaluates to a true value (see [[#booleans|the section about
     232booleans]] below). When a <test> evaluates to a true value, then the
     233remaining <expression>s in its <clause> are evaluated in order, and
     234the result(s) of the last <expression> in the <clause> is(are)
     235returned as the result(s) of the entire cond expression. If the
     236selected <clause> contains only the <test> and no <expression>s, then
     237the value of the <test> is returned as the result.  If the selected
     238<clause> uses the => alternate form, then the <expression> is
     239evaluated. Its value must be a procedure that accepts one argument;
     240this procedure is then called on the value of the <test> and the
     241value(s) returned by this procedure is(are) returned by the cond
     242expression. If all <test>s evaluate to false values, and there is no
     243else clause, then the result of the conditional expression is
    242244unspecified; if there is an else clause, then its <expression>s are
    243245evaluated, and the value(s) of the last one is(are) returned.
     
    257259 ((<datum[1]> ...) <expression[1]> <expression[2]> ...),
    258260
    259 where each <datum> is an external representation of some object. All
    260 the <datum>s must be distinct. The last <clause> may be an "else
    261 clause," which has the form
    262 
    263  (else <expression[1]> <expression[2]> ...).
     261where each <datum> is an external representation of some object.
     262Alternatively, as per R7RS, a <clause> may be of the form
     263
     264 ((<datum[1]> ...) => <expression>).
     265
     266All the <datum>s must be distinct. The last <clause> may be an
     267"else clause," which has one of the following two forms:
     268
     269 (else <expression[1]> <expression[2]> ...)
     270 (else => <expression>).      ; R7RS extension
    264271
    265272Semantics: A case expression is evaluated as follows. <Key> is
    266273evaluated and its result is compared against each <datum>. If the
    267 result of evaluating <key> is equivalent (in the sense of eqv?; see
    268 section 6.1) to a <datum>, then the expressions in the corresponding
    269 <clause> are evaluated from left to right and the result(s) of the last
    270 expression in the <clause> is(are) returned as the result(s) of the
    271 case expression. If the result of evaluating <key> is different from
     274result of evaluating <key> is equivalent (in the sense of {{eqv?}};
     275see [[#equivalence-predicates|below]]) to a <datum>, then the
     276expressions in the corresponding <clause> are evaluated from left to
     277right and the result(s) of the last expression in the <clause> is(are)
     278returned as the result(s) of the case expression. If the selected
     279<clause> uses the => alternate form (an R7RS extension), then the
     280<expression> is evaluated. Its value must be a procedure that accepts
     281one argument; this procedure is then called on the value of the <key>
     282and the value(s) returned by this procedure is(are) returned by the
     283case expression.  If the result of evaluating <key> is different from
    272284every <datum>, then if there is an else clause its expressions are
    273285evaluated and the result(s) of the last is(are) the result(s) of the
     
    289301
    290302The <test> expressions are evaluated from left to right, and the value
    291 of the first expression that evaluates to a false value (see section
    292 6.3.1) is returned. Any remaining expressions are not evaluated. If all
    293 the expressions evaluate to true values, the value of the last
    294 expression is returned. If there are no expressions then #t is
    295 returned.
     303of the first expression that evaluates to a false value (see
     304[[#booleans|the section about booleans]]) is returned. Any remaining
     305expressions are not evaluated. If all the expressions evaluate to true
     306values, the value of the last expression is returned. If there are no
     307expressions then #t is returned.
    296308
    297309 (and (= 2 2) (> 2 1))                   ===>  #t
     
    303315
    304316The <test> expressions are evaluated from left to right, and the value
    305 of the first expression that evaluates to a true value (see section
    306 6.3.1) is returned. Any remaining expressions are not evaluated. If all
    307 expressions evaluate to false values, the value of the last expression
    308 is returned. If there are no expressions then #f is returned.
     317of the first expression that evaluates to a true value (see
     318[[#booleans|the section about booleans]]) is returned. Any remaining
     319expressions are not evaluated. If all expressions evaluate to false
     320values, the value of the last expression is returned. If there are no
     321expressions then #f is returned.
    309322
    310323 (or (= 2 2) (> 2 1))                    ===>  #t
     
    349362     (* z x)))                           ===>  35
    350363
    351 See also named let, section 4.2.4.
     364See also "named let", [[#iteration|below]].
    352365
    353366<macro>(let* <bindings> <body>)</macro><br>
     
    440453the bindings of the <variable>s, and then the iteration phase begins.
    441454
    442 Each iteration begins by evaluating <test>; if the result is false (see
    443 section 6.3.1), then the <command> expressions are evaluated in order
    444 for effect, the <step> expressions are evaluated in some unspecified
    445 order, the <variable>s are bound to fresh locations, the results of the
    446 <step>s are stored in the bindings of the <variable>s, and the next
    447 iteration begins.
     455Each iteration begins by evaluating <test>; if the result is false
     456(see [[#booleans|the section about booleans]]), then the <command>
     457expressions are evaluated in order for effect, the <step> expressions
     458are evaluated in some unspecified order, the <variable>s are bound to
     459fresh locations, the results of the <step>s are stored in the bindings
     460of the <variable>s, and the next iteration begins.
    448461
    449462If <test> evaluates to a true value, then the <expression>s are
     
    499512
    500513The delay construct is used together with the procedure force to
    501 implement lazy evaluation or call by need. (delay <expression>) returns
    502 an object called a promise which at some point in the future may be
    503 asked (by the force procedure) to evaluate <expression>, and deliver
    504 the resulting value. The effect of <expression> returning multiple
    505 values is unspecified.
    506 
    507 See the description of force (section 6.4) for a more complete
    508 description of delay.
     514implement lazy evaluation or call by need. {{(delay <expression>)}}
     515returns an object called a promise which at some point in the future
     516may be asked (by the force procedure) to evaluate {{<expression>}},
     517and deliver the resulting value. The {{<expression>}} may return
     518multiple values, which will be correctly memoized and returned by
     519subsequent calls to {{force}}.  This is a CHICKEN extension to R5RS.
     520
     521See the description of {{force}} (under [[#control-features|Control
     522features]], below) for a more complete description of {{delay}}.
     523
     524<macro>(delay-force <expression>)</macro><br>
     525
     526The expression {{(delay-force expression)}} is conceptually similar to
     527{{(delay (force expression))}}, with the difference that forcing the
     528result of {{delay-force}} will in effect result in a tail call to
     529{{(force expression)}}, while forcing the result of
     530{{(delay (force expression))}} might not.
     531
     532Thus iterative lazy algorithms that might result in a long series of
     533chains of delay and force can be rewritten using delay-force to
     534prevent consuming unbounded space during evaluation.
     535
     536The {{delay-force}} macro is a CHICKEN extension to R5RS, taken from
     537R7RS.
     538
     539See the description of force (under [[#control-features|Control
     540features]], below) for a more complete description of delayed
     541evaluation.
     542
     543<procedure>(make-promise obj)</procedure>
     544
     545The make-promise procedure returns a promise which, when forced, will
     546return {{obj}} . It is similar to {{delay}}, but does not delay its
     547argument: it is a procedure rather than syntax. If {{obj}} is already
     548a promise, it is returned.
     549
     550This procedure is a CHICKEN extension to R5RS, taken from R7RS.
    509551
    510552==== Quasiquotation
     
    600642    throughout its scope to avoid conflicts with other identifiers.
    601643    Note that a define at top level may or may not introduce a binding;
    602     see section 5.2.
     644    this depends on whether the binding already existed before (in which
     645    case its value will be overridden).
    603646
    604647*   If a macro transformer inserts a free reference to an identifier,
     
    612655bind syntactic keywords to macro transformers instead of binding
    613656variables to locations that contain values. Syntactic keywords may also
    614 be bound at top level; see section 5.3.
     657be bound at top level.
    615658
    616659<macro>(let-syntax <bindings> <body>)</macro><br>
     
    798841inadvertent captures of free identifiers.
    799842
    800 As an example, if let and cond are defined as in section 7.3 then they
    801 are hygienic (as required) and the following is not an error.
     843As an example, if let and cond are defined as usual, then they are
     844hygienic (as required) and the following is not an error.
    802845
    803846 (let ((=> #f))
     
    835878
    836879A program may use a top-level definition to bind any variable. It may
    837 subsequently alter any such binding by an assignment (see 4.1.6). These
    838 operations do not modify the behavior of Scheme's built-in procedures.
    839 Altering any top-level binding that has not been introduced by a
    840 definition has an unspecified effect on the behavior of the built-in
    841 procedures.
     880subsequently alter any such binding by an assignment (see
     881[[#assignments|assignments]], above). These operations do
     882not modify the behavior of Scheme's built-in procedures. Altering any
     883top-level binding that has not been introduced by a definition has an
     884unspecified effect on the behavior of the built-in procedures.
    842885
    843886=== Equivalence predicates
     
    868911                ===>  #t
    869912
    870 Note:  This assumes that neither obj[1] nor obj[2] is an
    871 "uninterned symbol" as alluded to in section 6.3.3. This
     913Note: This assumes that neither obj[1] nor obj[2] is an "uninterned
     914symbol" as alluded to in the section on [[#symbols|symbols]]. This
    872915report does not presume to specify the behavior of eqv? on
    873916implementation-dependent extensions.
    874917
    875918*   obj[1] and obj[2] are both numbers, are numerically equal (see =,
    876     section 6.2), and are either both exact or both inexact.
     919    under [[#numerical-operations|numerical operations]]), and are
     920    either both exact or both inexact.
    877921
    878922*   obj[1] and obj[2] are both characters and are the same character
    879     according to the char=? procedure (section 6.3.4).
     923    according to the char=? procedure (see "[[#characters|characters]]").
    880924
    881925*   both obj[1] and obj[2] are the empty list.
    882926
    883927*   obj[1] and obj[2] are pairs, vectors, or strings that denote the
    884     same locations in the store (section 3.4).
     928    same locations in the store.
    885929
    886930*   obj[1] and obj[2] are procedures whose location tags are equal
    887     (section 4.1.4).
     931    (see "[[#procedures|procedures]]").
    888932
    889933The eqv? procedure returns #f if:
    890934
    891 *   obj[1] and obj[2] are of different types (section 3.2).
     935*   obj[1] and obj[2] are of different types.
    892936
    893937*   one of obj[1] and obj[2] is #t but the other is #f.
     
    11241168result, then it may either report the violation of an implementation
    11251169restriction or it may silently coerce its result to an inexact value.
    1126 See section 6.2.3.
     1170See [[#implementation-restrictions|the next section]].
    11271171
    11281172With the exception of inexact->exact, the operations described in this
     
    11361180==== Implementation restrictions
    11371181
    1138 Implementations of Scheme are not required to implement the whole tower
    1139 of subtypes given in section 6.2.1, but they must implement a coherent
    1140 subset consistent with both the purposes of the implementation and the
    1141 spirit of the Scheme language. For example, an implementation in which
    1142 all numbers are real may still be quite useful.
     1182Implementations of Scheme are not required to implement the whole
     1183tower of subtypes given under "[[#numerical-types|Numerical types]]",
     1184but they must implement a coherent subset consistent with both the
     1185purposes of the implementation and the spirit of the Scheme
     1186language. For example, an implementation in which all numbers are real
     1187may still be quite useful.
    11431188
    11441189Implementations may also support only a limited range of numbers of any
     
    12171262==== Syntax of numerical constants
    12181263
    1219 The syntax of the written representations for numbers is described
    1220 formally in section 7.1.1. Note that case is not significant in
    1221 numerical constants.
     1264For a complete formal description of the syntax of the written
     1265representations for numbers, see the R5RS report. Note that case is
     1266not significant in numerical constants.
    12221267
    12231268A number may be written in binary, octal, decimal, or hexadecimal by
     
    12541299==== Numerical operations
    12551300
    1256 The reader is referred to section 1.3.3 for a summary of the naming
    1257 conventions used to specify restrictions on the types of arguments to
    1258 numerical routines. The examples used in this section assume that any
     1301The numerical routines described below have argument restrictions,
     1302which are encoded in the naming conventions of the arguments as
     1303given in the procedure's signature.  The conventions are as follows:
     1304
     1305; {{obj}} : any object
     1306; {{list, list1, ... listj, ... list : (see "[[#pairs-and-lists|Pairs and lists]]" below)
     1307; {{z, z1, ... zj, ...}} : complex number (currently not supported by CHICKEN core, see the "[[/egg/numbers|numbers]]" egg)
     1308; {{x, x1, ... xj, ...}} : real number
     1309; {{y, y1, ... yj, ...}} : real number
     1310; {{q, q1, ... qj, ...}} : rational number (NOTE: fractional numbers are not supported by CHICKEN core, see the "[[/egg/numbers|numbers]]" egg)
     1311; {{n, n1, ... nj, ...}} : integer
     1312; {{k, k1, ... kj, ...}} : exact non-negative integer
     1313
     1314The examples used in this section assume that any
    12591315numerical constant written using an exact notation is indeed
    12601316represented as an exact number. Some examples also assume that certain
     
    15991655These procedures implement the natural one-to-one correspondence
    16001656between exact and inexact integers throughout an
    1601 implementation-dependent range. See section 6.2.3.
     1657implementation-dependent range.
     1658See "[[#implementation-restrictions|Implementation restrictions]]".
    16021659
    16031660==== Numerical input and output
     
    18011858element in each case is <datum>. This convention is supported so that
    18021859arbitrary Scheme programs may be represented as lists. That is,
    1803 according to Scheme's grammar, every <expression> is also a <datum>
    1804 (see section 7.1.2). Among other things, this permits the use of the
    1805 read procedure to parse Scheme programs. See section 3.3.
     1860according to Scheme's grammar, every <expression> is also a <datum>.
     1861Among other things, this permits the use of the read procedure to
     1862parse Scheme programs.
    18061863
    18071864<procedure>(pair? obj)</procedure><br>
     
    20332090
    20342091The rules for writing a symbol are exactly the same as the rules for
    2035 writing an identifier; see sections 2.1 and 7.1.1.
     2092writing an identifier.
    20362093
    20372094It is guaranteed that any symbol that has been returned as part of a
     
    20672124
    20682125Returns the name of symbol as a string. If the symbol was part of an
    2069 object returned as the value of a literal expression (section 4.1.2) or
    2070 by a call to the read procedure, and its name contains alphabetic
    2071 characters, then the string returned will contain characters in the
    2072 implementation's preferred standard case -- some implementations will
    2073 prefer upper case, others lower case. If the symbol was returned by
    2074 string->symbol, the case of characters in the string returned will be
    2075 the same as the case in the string that was passed to string->symbol.
    2076 It is an error to apply mutation procedures like string-set! to strings
    2077 returned by this procedure.
     2126object returned as the value of a literal expression (see
     2127"[[#literal-expressions|literal expressions]]") or by a call to the
     2128read procedure, and its name contains alphabetic characters, then the
     2129string returned will contain characters in the implementation's
     2130preferred standard case -- some implementations will prefer upper
     2131case, others lower case. If the symbol was returned by string->symbol,
     2132the case of characters in the string returned will be the same as the
     2133case in the string that was passed to string->symbol.  It is an error
     2134to apply mutation procedures like string-set! to strings returned by
     2135this procedure.
    20782136
    20792137The following examples assume that the implementation's standard case
     
    25242582<procedure>(force promise)</procedure><br>
    25252583
    2526 Forces the value of promise (see delay, section 4.2.5). If no value has
    2527 been computed for the promise, then a value is computed and returned.
    2528 The value of the promise is cached (or "memoized") so that if it is
    2529 forced a second time, the previously computed value is returned.
     2584Forces the value of promise (see "[[#delayed-evaluation|delayed
     2585evaluation]]"). If no value has been computed for the promise, then a
     2586value is computed and returned.  The value of the promise is cached
     2587(or "memoized") so that if it is forced a second time, the previously
     2588computed value is returned.
    25302589
    25312590 (force (delay (+ 1 2)))           ===>  3
     
    29352994
    29362995Read converts external representations of Scheme objects into the
    2937 objects themselves. That is, it is a parser for the nonterminal <datum>
    2938 (see sections 7.1.2 and 6.3.2). Read returns the next object parsable
    2939 from the given input port, updating port to point to the first
    2940 character past the end of the external representation of the object.
     2996objects themselves. That is, it is a parser for the nonterminal
     2997<datum> (see also "[[#pairs-and-lists|pairs and lists]]"). Read
     2998returns the next object parsable from the given input port, updating
     2999port to point to the first character past the end of the external
     3000representation of the object.
    29413001
    29423002If an end of file is encountered in the input before any characters are
  • wiki/man/4/The User's Manual

    r30147 r30951  
    77</nowiki>
    88
    9 This is the manual for Chicken Scheme, version 4.8.0
     9This is the manual for Chicken Scheme, version 4.9.0
    1010
    1111; [[Getting started]] : What is CHICKEN and how do I use it?
  • wiki/man/4/Types

    r28357 r30951  
    2525compiler options for using type-information in this manner:
    2626
    27 {{-scrutinize}} will look for possibly incorrectly typed arguments to
    28 library procedure calls and generate warnings in such cases.
    29 
    3027{{-specialize}} will replace certain generic library procedure calls
    3128with faster type-specific operations.
     
    104101<tr><td>{{(procedure [NAME] (VALUETYPE ... [#!optional VALUETYPE ...] [#!rest [VALUETYPE]]) . RESULTS)}}</td><td>procedure type, optionally with name</td></tr>
    105102<tr><td>{{(VALUETYPE ... [#!optional VALUETYPE ...] [#!rest [VALUETYPE]] -> . RESULTS)}}</td><td>alternative procedure type syntax</td></tr>
    106 <tr><td>{{(VALUETYPE ... [#!optional VALUETYPE ...] [#!rest [VALUETYPE]] --> . RESULTS)}}</td><td>procedure type that is declared not to modify locally held state</td></tr>
     103<tr><td>{{(VALUETYPE ... [#!optional VALUETYPE ...] [#!rest [VALUETYPE]] --> . RESULTS)}}</td><td>procedure type that is declared to modify locally held state</td></tr>
    107104<tr><td>{{(VALUETYPE -> VALUETYPE : VALUETYPE)}}</td><td>predicate procedure type</td></tr>
    108105<tr><td>{{(forall (TYPEVAR ...) VALUETYPE)}}</td><td>polymorphic type</td></tr>
     
    116113<tr><td>{{*}}</td><td>any value</td></tr>
    117114<tr><td>{{blob}}</td><td>byte vector</td></tr>
    118 <tr><td>{{boolean}}</td><td>boolean</td></tr>
     115<tr><td>{{boolean}}</td><td>true or false</td></tr>
    119116<tr><td>{{char}}</td><td>character</td></tr>
    120117<tr><td>{{eof}}</td><td>end-of-file object</td></tr>
     118<tr><td>{{false}}</td><td>boolean false</td></tr>
    121119<tr><td>{{fixnum}}</td><td>word-sized integer</td></tr>
    122120<tr><td>{{float}}</td><td>floating-point number</td></tr>
     
    132130<tr><td>{{string}}</td><td>string</td></tr>
    133131<tr><td>{{symbol}}</td><td>symbol</td></tr>
     132<tr><td>{{true}}</td><td>boolean true</td></tr>
    134133<tr><td>{{vector}}</td><td>vector</td></tr>
    135134</table>
     
    205204</table>
    206205
     206For portability the aliases {{&optional}} and {{&rest}} are allowed
     207in procedure type declarations as an alternative to {{#!optional}} and
     208{{#!rest}}, respectively.
     209
    207210
    208211==== Predicates
     
    307310===== compiler-typecase
    308311
    309 <syntax>(compiler-typecase EXP (TYPE BODY ...) ... [(else BODY ...)])</syntax>
     312<syntax>(compiler-typecase EXP (TYPE BODY ... [(else BODY ...)]) ...)</syntax>
    310313
    311314Evaluates {{EXP}} and executes the first clause which names a type that
  • wiki/man/4/Unit data-structures

    r30603 r30951  
    3131and defaults to {{eqv?}}. {{alist-update!}} is the destructive version of {{alist-update}}.
    3232
    33 {{alist-update}} (the non-destructive version) was introduced in Chicken 4.7.4.
    3433
    3534==== atom?
     
    254253==== topological-sort
    255254
    256 <procedure>(topological-sort DG PRED)</procedure>
    257 
    258 Sorts the directed graph dg {{DG}} so that for every edge from vertex
     255<procedure>(topological-sort DAG PRED)</procedure>
     256
     257Sorts the directed acyclic graph dag {{DAG}} so that for every edge from vertex
    259258u to v, u will come before v in the resulting list of vertices.
    260259
    261 {{DG}} is a list of sublists. The car of each sublist is a
     260{{DAG}} is a list of sublists. The car of each sublist is a
    262261vertex. The cdr is the adjacency list of that vertex, i.e. a list of
    263262all vertices to which there exists an edge from the car vertex.
    264263{{pred}} is procedure of two arguments that should compare vertices
    265 for equality. 
     264for equality.
    266265
    267266Time complexity: O (|V| + |E|)
     
    283282</enscript>
    284283
    285 If the {{DG}} contains cycles a condition will be signaled. You can react to this event like so:
    286 
    287 <enscript language=scheme>
    288 (define cyclic-dg '((north east) (east north)))
    289 
    290 (condition-case (topological-sort cyclic-dg eq?)
    291   ((cycle) (print "Your DG contains cycles")))
    292 
    293 </enscript>
     284If a cycle is detected during the sorting process, an exception of the
     285condition kinds {{(exn runtime cycle)}} is thrown.
    294286
    295287=== Random numbers
  • wiki/man/4/Unit irregex

    r30672 r30951  
    9393(irregex-search "foobar" "abcFOOBARdef") => #f
    9494
    95 (irregex-search "foobar" "abcFOOBARdef" 'i) => #<match>
     95(irregex-search (irregex "foobar" 'i) "abcFOOBARdef") => #<match>
    9696
    9797(irregex-search '(w/nocase "foobar") "abcFOOBARdef") => #<match>
     
    501501</enscript>
    502502
    503 Ranges are introduced with the \q{/} operator.  Any strings or
    504 characters in the \q{/} are flattened and then taken in pairs to
     503Ranges are introduced with the {{/}} operator.  Any strings or
     504characters in the {{/}} are flattened and then taken in pairs to
    505505represent the start and end points, inclusive, of character ranges.
    506506
     
    511511</enscript>
    512512
    513 In addition, a number of set algebra operations are provided.  \q{or},
     513In addition, a number of set algebra operations are provided.  {{or}},
    514514of course, has the same meaning, but when all the options are
    515515character sets it can be thought of as the set union operator.  This
    516 is further extended by the \q{&} set intersection, \q{-} set
    517 difference, and \q{~} set complement operators.
     516is further extended by the {{&}} set intersection, {{-}} set
     517difference, and {{~}} set complement operators.
    518518
    519519<enscript highlight=scheme>
     
    536536
    537537<enscript highlight=scheme>
    538 (irregex-match '(: "foo" eow) "foo") => #<match>
    539 
    540 (irregex-match '(: "foo" eow) "foo!") => #<match>
    541 
    542 (irregex-match '(: "foo" eow) "foof") => #f
     538(irregex-search '(: "foo" eow) "foo") => #<match>
     539
     540(irregex-search '(: "foo" eow) "foo!") => #<match>
     541
     542(irregex-search '(: "foo" eow) "foof") => #f
    543543</enscript>
    544544
     
    557557
    558558<enscript highlight=scheme>
    559 (irregex-match '(: "regular" (look-ahead " expression"))
    560                "regular expression")
     559(irregex-search '(: "regular" (look-ahead " expression"))
     560                "regular expression")
    561561 => #<match>
    562562</enscript>
    563563
    564 The most general case, of course, would be an \q{and} pattern to
    565 complement the \q{or} pattern - all the patterns must match or the
     564The most general case, of course, would be an {{and}} pattern to
     565complement the {{or}} pattern - all the patterns must match or the
    566566whole pattern fails.  This may be provided in a future release,
    567567although it (and look-ahead and look-behind assertions) are unlikely
     
    812812
    813813Returns an optimized SRE matching any of the literal strings
    814 in the list, like Emacs' \q{regexp-opt}.  Note this optimization
     814in the list, like Emacs' {{regexp-opt}}.  Note this optimization
    815815doesn't help when irregex is able to build a DFA.
    816816
  • wiki/man/4/Unit library

    r30610 r30951  
    519519currently running, which is one of the following:
    520520
     521 arm
    521522 alpha
    522523 mips
     
    549550is currently running, which is one of the following:
    550551
     552 android
    551553 windows
    552554 unix
    553  macos
    554555 ecos
    555556 unknown
     
    569570 macosx
    570571 hpux
     572 dragonfly
     573 haiku
    571574 solaris
    572575 sunos
     576 aix
     577 hurd
    573578 unknown
    574579
     
    924929
    925930Stores {{VALUE}} under the key {{PROPERTY}} in the property list of
    926 {{SYMBOL}} replacing any previously stored value. Returns the newly stored value.
     931{{SYMBOL}} replacing any previously stored value.
    927932
    928933===== remprop!
     
    12681273If the first argument is a symbol, then this procedure is equivalent to {{set-read-syntax!}}.
    12691274
     1275{{PROC}} may be {{#f}} to disable previously defined "sharp" read syntax.
     1276
    12701277
    12711278==== set-parameterized-read-syntax!
     
    12791286If the first argument is a symbol, then this procedure is equivalent to {{set-read-syntax!}}.
    12801287
     1288{{PROC}} may be {{#f}} to disable previously defined parameterized read syntax.
     1289
    12811290
    12821291==== copy-read-table
  • wiki/man/4/Unit posix

    r30815 r30951  
    599599==== file-creation-mode
    600600
    601 <procedure>(file-creation-mode MODE)</procedure>
     601<procedure>(file-creation-mode [MODE])</procedure>
    602602
    603603Returns the initial file permissions used for newly created files
    604 (as with {{umask(2)}}. You can set the mode by executing
     604(as with {{umask(2)}}).  If {{MODE}} is supplied, the mode is
     605changed to this value.  You can set the mode by executing
    605606
    606607  (set! (file-creation-mode) MODE)
     
    647648is given to the invoked process. Note that {{execvp(3)}} respects the
    648649current setting of the {{PATH}} environment variable while {{execve(3)}} does not.
    649 
     650 
    650651This procedure never returns; it either replaces the process with a new one
    651652or it raises an exception in case something went wrong executing the program.
    652653
    653 CHICKEN makes extensive use of non-blocking IO. Therefore, it is quite possible
    654 that the new process will inherit file descriptors with the O_NONBLOCK flag set.
    655 As this is not the default it may not be what the process expects. Therefore you
    656 may have to manually unset this flag on the file descriptors after the new
    657 process has started.
    658 
    659654==== process-fork
    660655
    661 <procedure>(process-fork [THUNK])</procedure>
     656<procedure>(process-fork [THUNK [KILLOTHERS?]])</procedure>
    662657
    663658Creates a new child process with the UNIX system call
    664659{{fork()}}. Returns either the PID of the child process or 0. If
    665660{{THUNK}} is given, then the child process calls it as a procedure
    666 with no arguments and terminates.
     661with no arguments and terminates. If {{THUNK}} is given and the
     662optional argument {{KILLOTHERS?}} is true, then kill all other
     663existing threads in the child process, leaving only the current thread
     664to run {{THUNK}} and terminate.
    667665
    668666==== process-run
     
    736734<procedure>(process* COMMAND ARGUMENT-LIST [ENVIRONMENT-LIST])</procedure>
    737735
    738 Like {{process}} but does not cause the subprocess to share standard
    739 error with the current process.  It returns 4 values: an input port
    740 from which data written by the sub-process can be read, an output port
    741 from which any data written to will be received as input in the
    742 sub-process, the process-id of the started sub-process, and an input
    743 port from which data written by the sub-process to {{stderr}} can be
    744 read.
     736Like {{process}} but returns 4 values: an input port from
     737which data written by the sub-process can be read, an output port from
     738which any data written to will be received as input in the sub-process,
     739the process-id of the started sub-process, and an input port from
     740which data written by the sub-process to {{stderr}} can be read.
    745741
    746742==== sleep
     
    818814{{#f}} is returned.
    819815
     816Note: on Android systems, the user-specific string is always {{""}},
     817since {{pw_gecos}} is not available in the C {{passwd}} struct on that
     818platform.
     819
    820820==== current-group-id
    821821
     
    943943
    944944* {{(set! (signal-handler SIG) PROC)}} can be used as an alternative to {{(set-signal-handler! SIG PROC)}}
     945
     946* Any signal handlers for the signals {{signal/segv}}, {{signal/bus}}, {{signal/fpe}} and {{signal/ill}} will be ignored and these signals will always trigger an exception, unless the executable was started with the {{-:S}} runtime option. This feature is only available on platforms that support the {{sigprocmask(3)}} POSIX API function.
    945947
    946948==== set-signal-mask!
     
    10021004<constant>signal/usr1</constant><br>
    10031005<constant>signal/usr2</constant><br>
     1006<constant>signal/bus</constant><br>
    10041007<constant>signal/winch</constant>
     1008<constant>signal/break</constant>
    10051009
    10061010These variables contain signal codes for use with {{process-signal}},  {{set-signal-handler!}},  {{signal-handler}},  {{signal-masked?}},  {{signal-mask!}},  or {{signal-unmask!}}.
     
    12491253string) and invokes the procedure {{action}} for all files in which
    12501254the procedure {{test}} is true.  {{test}} may be a procedure of one
    1251 argument or a regular-expression string that will be matched with a
    1252 full pathname using {{irregex-match}}.  {{action}} should be a
    1253 procedure of two arguments: the currently encountered file and the
    1254 result of the previous invocation of {{action}}, or, if this is the
    1255 first invocation, the value of {{seed}}. {{test}} defaults to
    1256 {{(constantly #t)}}, {{action}} defaults to {{cons}}, {{seed}}
    1257 defaults to {{()}}.  {{limit}} should be a procedure of one argument
    1258 that is called for each nested directory and which should return true,
    1259 if that directory is to be traversed recursively. {{limit}} may also
    1260 be an exact integer that gives the maximum recursion depth. For
    1261 example, a depth of {{0}} means that only files in the top-level,
    1262 specified directory are to be traversed. In this case, all nested
    1263 directories are ignored.  {{limit}} may also be {{#f}} (the default),
    1264 which is equivalent to {{(constantly #t)}}.
     1255argument or an irregex object, regex string or SRE expression that
     1256will be matched with a full pathname using {{irregex-match}}.
     1257{{action}} should be a procedure of two arguments: the currently
     1258encountered file and the result of the previous invocation of
     1259{{action}}, or, if this is the first invocation, the value of
     1260{{seed}}. {{test}} defaults to {{(constantly #t)}}, {{action}}
     1261defaults to {{cons}}, {{seed}} defaults to {{()}}.  {{limit}} should
     1262be a procedure of one argument that is called for each nested
     1263directory and which should return true, if that directory is to be
     1264traversed recursively. {{limit}} may also be an exact integer that
     1265gives the maximum recursion depth. For example, a depth of {{0}} means
     1266that only files in the top-level, specified directory are to be
     1267traversed. In this case, all nested directories are ignored.
     1268{{limit}} may also be {{#f}} (the default), which is equivalent to
     1269{{(constantly #t)}}.
    12651270
    12661271If {{dotfiles}} is given and true, then files starting with a "{{.}}"
     
    13491354; {{create-symbolic-link}} : {{link}}
    13501355; {{current-directory}} : {{curdir}}
    1351 ; {{current-effective-groupd-id}} : {{getegid}}
     1356; {{current-effective-group-id}} : {{getegid}}
    13521357; {{current-effective-user-id}} : {{geteuid}}
    13531358; {{current-group-id}} : {{getgid}}
     
    14621467 change-directory*
    14631468 change-file-owner
    1464  current-user-id  current-group-id  current-effective-user-id  current-effective-groupd-id
     1469 current-user-id  current-group-id  current-effective-user-id  current-effective-group-id
    14651470 set-user-id!  set-group-id!
    14661471 create-session
     
    14701475 file-lock  file-lock/blocking  file-unlock  file-test-lock
    14711476 create-fifo  fifo?
    1472  prot/...
    1473  map/...
    1474  map-file-to-memory  unmap-file-from-memory  memory-mapped-file-pointer  memory-mapped-file?
    14751477 set-alarm!
    14761478 terminal-port?  terminal-name
  • wiki/man/4/Unit srfi-4

    r17862 r30951  
    164164 (set! x '#u8(1 2 3))
    165165
    166 will set {{x}} to the object {{#u8(1 2 3)}}. Literal homogeneous vectors must be quoted just like heterogeneous vectors must be. Homogeneous vectors can appear in quasiquotations but must not contain {{unquote}} or {{unquote-splicing}} forms.  ''I.e.'',
     166will set {{x}} to the object {{#u8(1 2 3)}}. Since CHICKEN 4.9.0, literal homogeneous vectors do not have to be quoted. Homogeneous vectors can appear in quasiquotations but must not contain {{unquote}} or {{unquote-splicing}} forms.  ''I.e.'',
    167167
    168168 `(,x #u8(1 2))        ; legal
     
    182182Return {{#t}} if {{obj}} is an object of the specified type or {{#f}} if not.
    183183
     184<procedure>(number-vector? OBJ)</procedure>
     185
     186Return {{#t}} if {{obj}} is a number vector, {{#f}} if not.  A "number vector" is any of the homogeneous number vector types defined by SRFI-4, ie it's one of {{u8vector}}, {{s8vector}}, {{u16vector}}, {{s16vector}}, {{u32vector}}, {{s32vector}}, {{f32vector}} or {{f64vector}}).
     187
     188
    184189=== Constructors
    185190
     
    305310with the datatype of VECTOR.
    306311
     312=== Release number vectors allocated in static memory
     313
     314<procedure>(release-number-vector NVECTOR)</procedure>
     315
     316Release the storage of a SRFI-4 vector that was allocated in
     317non-garbage collected memory (using one of the {{make-XXXvector}}
     318constructor procedures). The effect of calling this procedure with a
     319number vector allocated in normal garbage collected memory is
     320undefined.
     321
     322
    307323---
    308324Previous: [[Unit srfi-1]]
  • wiki/man/4/Unit srfi-69

    r30469 r30951  
    377377Synonym for {{eq?-hash}}.
    378378
     379
     380=== recursive-hash-max-depth
     381
     382<parameter>(recursive-hash-max-depth)</parameter>
     383
     384The maximum structure depth to follow when computing a hash value. The default is {{4}}.
     385
     386
     387=== recursive-hash-max-length
     388
     389<parameter>(recursive-hash-max-length)</parameter>
     390
     391The maximum vector length to follow when computing a hash value. The default is {{4}}.
     392
    379393Previous: [[Unit srfi-18]]
    380394Next: [[Unit posix]]
     395
  • wiki/man/4/Using the compiler

    r30609 r30951  
    8989; -local : Assume toplevel variables defined in the current compilation unit are not externally modified. This gives the compiler more opportunities for inlining. Note that this may result in counter-intuitive and non-standard behaviour: an asssignment to an exported toplevel variable executed in a different compilation unit or in evaluated code will possibly not be seen by code executing in the current compilation unit.
    9090
     91; -lfa2 : Does an additional lightweight flow-analysis pass on the fully optimized program to remove more type checks.
     92
    9193; -module : wraps the compiled code in an implicit module named {{main}}, importing the {{scheme}} and {{chicken}} modules.
    9294
     
    101103; -no-module-registration : Do not generate module-registration code in the compiled code. This is only needed if you want to use an import library that is generated by other means (manually, for example).
    102104
    103 ; -no-parentheses-synonyms STYLE : Disables list delimiter synonyms, [..] and {...} for (...).
     105; -no-parentheses-synonyms : Disables list delimiter synonyms, [..] and {...} for (...).
    104106
    105107; -no-procedure-checks : disable procedure call checks
     
    127129     -optimize-level 3          is equivalent to -optimize-leaf-routines -local -inline -inline-global -specialize
    128130     -optimize-level 4          is equivalent to -optimize-leaf-routines -local -inline -inline-global -specialize -unsafe
    129      -optimize-level 5          is equivalent to -optimize-leaf-routines -block -inline -inline-global -specialize -unsafe -disable-interrupts -no-trace -no-lambda-info
     131     -optimize-level 5          is equivalent to -optimize-leaf-routines -block -inline -inline-global -specialize -unsafe -disable-interrupts -no-trace -no-lambda-info -clustering -lfa2
    130132
    131133; -output-file FILENAME : Specifies the pathname of the generated C file. Default is {{FILENAME.c}}.
     
    150152; -setup-mode : When locating extension, search the current directory first. By default, extensions are located first in the ''extension repository'', where {{chicken-install}} stores compiled extensions and their associated metadata.
    151153
    152 ; -scrutinize : Enable simple flow-analysis to catch common type errors and argument/result mismatches. You can also use the {{scrutinize}} declaration to enable scrutiny.
    153 
    154 ; -specialize : Enable simple flow-analysis for doing some type-directed optimizations. Implies {{-scrutinize}}.
     154; -specialize : Enable simple flow-analysis for doing some type-directed optimizations.
    155155
    156156; -strict-types : Assume that the type of variables is not changed by assignments. This gives more type-information during specialization, but violating this assumption will result in unsafe and incorrectly behaving code.
     
    413413
    414414Compiled to C, we get {{hello.c}}. We need the files {{chicken.h}},
    415 {{chicken-config.h}}, {{runtime.c}} and {{apply-hack.x86.S}} (or {{apply-hack.x86-64.S}}, depending on the target architecture), which contain the basic runtime system, plus the five basic library files {{library.c}},
    416 {{eval.c}}, {{expand.c}}, {{modules.c}}, {{chicken-syntax.c}} and {{build-version.c}}
     415{{chicken-config.h}} and {{runtime.c}}, which contain the basic
     416runtime system, plus the five basic library files {{library.c}},
     417{{eval.c}}, {{expand.c}}, {{modules.c}} and {{build-version.c}}
    417418which contain the same functionality as the library linked into a
    418419plain CHICKEN-compiled application, or which is available by
     
    431432  % cp $CHICKEN_BUILD/chicken-config.h  .
    432433  % cp $CHICKEN_BUILD/buildtag.h  .
    433   % cp $CHICKEN_BUILD/chicken-syntax.c .
    434   % cp $CHICKEN_BUILD/apply-hack.x86.S
    435434  % gcc -static -Os -fomit-frame-pointer -DHAVE_CHICKEN_CONFIG_H runtime.c build-version.c \
    436      library.c eval.c expand.c modules.c chicken-syntax.c apply-hack.x86.S hello.c -o hello -lm
     435     library.c eval.c expand.c modules.c hello.c -o hello -lm
    437436
    438437Now we have all files together, and can create an tarball containing all the files:
    439438
    440439 % tar cf hello.tar hello.c runtime.c build-version.c library.c eval.c extras.c \
    441    expand.c modules.c chicken.h chicken-config.h chicken-syntax.c apply-hack.x86
     440   expand.c modules.c chicken.h chicken-config.h
    442441 % gzip hello.tar
    443442
  • wiki/man/4/Using the interpreter

    r28761 r30951  
    4040; -K  -keyword-style STYLE : Enables alternative keyword syntax, where {{STYLE}} may be either {{prefix}} (as in Common Lisp) or {{suffix}} (as in DSSSL). Any other value is ignored.
    4141
    42 ; -n  -no-init : Do not load initialization-file. If this option is not given and the file {{./.csirc}} or {{$HOME/.csirc}} exists, then it is loaded before the read-eval-print loop commences.
    43 
    44 ;     -no-parentheses-synonyms STYLE : Disables list delimiter synonyms, [..] and {...} for (...).
     42; -n  -no-init : Do not load initialization-file. If this option is not given and the file {{$HOME/.csirc}} exists, then it is loaded before the read-eval-print loop commences.
     43
     44;     -no-parentheses-synonyms : Disables list delimiter synonyms, [..] and {...} for (...).
    4545
    4646;     -no-symbol-escape : Disables support for escaped symbols, the |...| form.
     
    175175; ,ln FILENAME ... : Load files and print result(s) of each top-level expression.
    176176
    177 ; ,m MODULENAME : switches the "current module" to {{MODULENAME}}, so expressions will be evaluated in the context of the given module.  To switch back to toplevel, use MODULENAME {{#f}}.  In compiled modules, only exported bindings will be visible to interactively entered code. In interpreted modules all bindings are visible.
     177; ,m MODULENAME : switches the "current module" to {{MODULENAME}}, so expressions will be evaluated in the context of the given module.  To switch back to toplevel, use {{#f}} as a MODULENAME.  In compiled modules, only exported bindings will be visible to interactively entered code. In interpreted modules all bindings are visible.
    178178
    179179; ,p EXP : Pretty-print evaluated expression {{EXP}}.
  • wiki/man/4/faq

    r30524 r30951  
    823823 $ chicken-install -p ~/eggs/ extensionname
    824824
    825 In order to make programs (including csi) see these eggs, you should set this variable when you run them. See the [[/man/4/Extensions#Changing repository location|Extensions/Changing repository location]] section of the manual for more information on that.
     825In order to make programs (including csi) see these eggs, you should set this variable when you run them. See the [[Extensions#Changing repository location|Extensions/Changing repository location]] section of the manual for more information on that.
    826826
    827827Alternatively, you can call the {{repository-path}} Scheme procedure before loading the eggs, as in:
Note: See TracChangeset for help on using the changeset viewer.