Outdated CHICKEN release

This is a manual page for an old and unsupported version of CHICKEN. If you are still using it, please consider migrating to the latest version. You can find the manual for the latest release here.

  1. Outdated CHICKEN release
  2. Parameters
    1. make-parameter
  3. Built-in parameters
    1. case-sensitive
    2. dynamic-load-libraries
    3. command-line-arguments
    4. current-read-table
    5. exit-handler
    6. eval-handler
    7. force-finalizers
    8. implicit-exit-handler
    9. keyword-style
    10. parentheses-synonyms
    11. symbol-escape
    12. load-verbose
    13. program-name
    14. repl-prompt
    15. reset-handler
    16. recursive-hash-max-depth
    17. recursive-hash-max-length


Parameters are CHICKEN's form of dynamic variables, except that they are procedures rather than actual variables. A parameter is a procedure of zero or one arguments. To retrieve the value of a parameter call the parameter-procedure with zero arguments. To change the setting of the parameter, call the parameter-procedure with the new value as argument:

(define foo (make-parameter 123))
(foo)                             ==> 123
(foo 99)
(foo)                             ==> 99

Parameters are fully thread-local, each thread of execution owns a local copy of a parameters' value.

CHICKEN implements SRFI-39.


[procedure] (make-parameter VALUE [GUARD])

Returns a procedure that accepts zero or one argument. Invoking the procedure with zero arguments returns VALUE. Invoking the procedure with one argument changes its value to the value of that argument and returns the new value (subsequent invocations with zero parameters return the new value). GUARD should be a procedure of a single argument. Any new values of the parameter (even the initial value) are passed to this procedure. The guard procedure should check the value and/or convert it to an appropriate form.

Built-in parameters

Certain behavior of the interpreter and compiled programs can be customized via the following built-in parameters:


[parameter] (case-sensitive)

If true, then read reads symbols and identifiers in case-sensitive mode and uppercase characters in symbols are printed escaped. Defaults to #t.


[parameter] (dynamic-load-libraries)

A list of strings containing shared libraries that should be checked for explicitly loaded library units (this facility is not available on all platforms). See load-library.


[parameter] (command-line-arguments)

Contains the list of arguments passed to this program, with the name of the program and any runtime options (all options starting with -:) removed.


[parameter] (current-read-table)

A read-table object that holds read-procedures for special non-standard read-syntax (see set-read-syntax! for more information).


[parameter] (exit-handler)

A procedure of a single optional argument. When exit is called, then this procedure will be invoked with the exit-code as argument. The default behavior is to terminate the program.


[parameter] (eval-handler)

A procedure of one or two arguments. When eval is invoked, it calls the value of this parameter with the same arguments. The default behavior is to evaluate the argument expression and to ignore the second parameter.


[parameter] (force-finalizers)

If true, force and execute all pending finalizers before exiting the program (either explicitly by exit or implicitly when the last toplevel expression has been executed). Default is #t.


[parameter] (implicit-exit-handler)

A procedure of no arguments. When the last toplevel expression of the program has executed, then the value of this parameter is called. The default behaviour is to invoke all pending finalizers.


[parameter] (keyword-style)

Enables alternative keyword syntax, where STYLE may be either #:prefix (as in Common Lisp), which recognizes symbols beginning with a colon as keywords, or #:suffix (as in DSSSL), which recognizes symbols ending with a colon as keywords. Any other value disables the alternative syntaxes. In the interpreter the default is #:suffix.


[parameter] (parentheses-synonyms)

If true, then the list delimiter synonyms #\[ #\] and #\{ #\} are enabled. Defaults to #t.


[parameter] (symbol-escape)

If true, then the symbol escape #\| #\| is enabled. Defaults to #t.


[parameter] (load-verbose)

A boolean indicating whether loading of source files, compiled code (if available) and compiled libraries should display a message.


[parameter] (program-name)

The name of the currently executing program. This is equivalent to (car (argv)) for compiled programs or the filename following the -script option in interpreted scripts.


[parameter] (repl-prompt)

A procedure that should evaluate to a string that will be printed before reading interactive input from the user in a read-eval-print loop. Defaults to (lambda () "#;N> ").


[parameter] (reset-handler)

A procedure of zero arguments that is called via reset. The default behavior in compiled code is to invoke the value of (exit-handler). The default behavior in the interpreter is to abort the current computation and to restart the read-eval-print loop.


[parameter] (recursive-hash-max-depth)

The maximum structure depth to follow when computing a hash value. The default is 4.


[parameter] (recursive-hash-max-length)

The maximum vector length to follow when computing a hash value. The default is 4.

Previous: Declarations Next: Exceptions