10. Customizations

STklos environement can be customized using Parameter Objects. These parmaters are listed below.

STklos procedure

(real-precision)
(real-precision value)

This parameter object permits to change the default precision used to print real numbers.

(real-precision)        => 15
(define f 0.123456789)
(display f)             => 0.123456789
(real-precision 3)
(display f)             => 0.123

STklos procedure

(accept-srfi-169-numbers)
(accept-srfi-169-numbers value)

This parameter object permits to change the behavior of the reader with underscores in numbers. Numbers with underscores are defined in ,(link-srfi 169). By default, this variable is true, meaning that underscores are accepted in numbers.

(accept-srfi-169-numbers)        => #t
(symbol? '1_000_000)             => #f
(number? '1_000_000)             => #t
(accept-srfi-169-numbers #f)
(symbol? '1_000_000)             => #t
(number? '1_000_000)             => #f

STklos procedure

(read-case-sensitive)
(read-case-sensitive value)

This parameter object permits to change the default behaviour of the read primitive when reading a symbol. If this parameter has a a true value a symbol is not converted to a default case when interned. Since R7RS requires that symbol are case insignificant, the default value of this parameter is #t.

(read-case-sensitive)        => `#t`
(read-from-string "ABC")     => ABC
(read-case-sensitive #f)
(read-from-string "ABC")     => abc
  • Default behaviour can be changed for a whole execution with the --case-sensitive or case-insensitive options.

  • See also syntax for special characters in symbols.

STklos procedure

(write-pretty-quotes)
(write-pretty-quotes value)

This parameter object permits to change the default behaviour of the display or write primitives when they write a list which starts with the symbol quote, quasiquote, unquote or unquote-splicing. If this parameter has a false value, the writer uses the list notation instead of a more human-readable value. By default, this parameter value is set to #t.

(let ((x ''a))
  (display x)
  (display " ")
  (write-pretty-quotes #f)
  (display x))               |- 'a (quote a)

STklos procedure

(load-path)
(load-path value)

load-path is a parameter object. It returns the current load path. The load path is a list of strings which correspond to the directories in which a file must be searched for loading. Directories of the load path are ,(emph "prepended") (in their apparition order) to the file name given to load or try-load until the file can be loaded.

The initial value of the current load path can be set from the shell, by setting the STKLOS_LOAD_PATH shell variable.

Giving a value to the parameter load-path permits to change the current list of paths.

STklos procedure

(load-suffixes)
(load-suffixes value)

load-suffixes is a parameter object. It returns the list of possible suffixes for a Scheme file. Each suffix, must be a string. Suffixes are appended (in their apparition order) to a file name is appended to a file name given to load or try-load until the file can be loaded.

STklos procedure

(load-verbose)
(load-verbose value)

load-verbose is a parameter object. It permits to display the path name of the files which are loaded by load or try-load on the current error port, when set to a true value. If load-verbose is set to #f, no message is printed.

STklos procedure

(thread-handler-error-show)
(thread-handler-error-show value)

When an untrapped error occurs in a thread, it produces an uncaught exception which can finally be trapped when the thread is joined. Setting the thread-handler-error-show parameter permits to see error message as soon as possible, even without joining the thread. This makes debugging easier. By default, this parameter is set to #t.

STklos procedure

(stklos-debug-level)

stklos-debug-level is a parameter objet. It permits to know the current debugging level. The default value of this parameter is 0 (meaning "no debug"). Note that the debugging level can also be set by the --debug option of the stklos(1) command.


1. Documentation about hygienic macros has been stolen in the SLIB manual
1. In fact define-module on a given name defines a new module only the first time it is invoked on this name. By this way, interactively reloading a module does not define a new entity, and the other modules which use it are not altered.
2. This transcript uses the default toplevel loop which displays the name of the current module in the evaluator prompt.
1. Under Unix, you can simply connect to a listening socket with the telnet of netcat command. For the given example, this can be achieved with netcat localhost 12345
2. Port 13, if open, can used for testing: making a connection to it permits to know the distant system’s idea of the time of day.
1. This section is an adaptation of Jeff Dalton’s (J.Dalton@ed.ac.uk) "Brief introduction to CLOS" which can be found at http://www.aiai.ed.ac.uk/~jeff/clos-guide.html