Next: , Previous: Scheme Syntax, Up: Read/Load/Eval


28.2 Reading Scheme Code

— Scheme Procedure: read [port]
— C Function: scm_read (port) |0 |1 |0

Read an s-expression from the input port port, or from the current input port if port is not specified. Discard any whitespace before the next token.

The behaviour of Guile's Scheme reader can be modified by manipulating its read options. For more information about options, See General option interface. If you want to know which reader options are available, See Reader options.

— Scheme Procedure: read-options-interface [setting]
— C Function: scm_read_options (setting) |0 |1 |0

Display the current settings of the reader options. If setting is omitted, display the current settings in short form. Otherwise, setting should be one of the following symbols:

help
Display the complete option settings.
full
Like help, but also print programmer options.

— Scheme Procedure: read-enable option-name
— Scheme Procedure: read-disable option-name
— Scheme Procedure: read-set! option-name value

Modify the read options. read-enable should be used with boolean options and switches them on, read-disable switches them off. read-set! can be used to set an option to a specific value.