Next: , Previous: Lexical Conventions, Up: Lexical Conventions


4.8.1 Common-Lisp Read Syntax

— Read syntax: #\token

If token is a sequence of two or more digits, then this syntax is equivalent to #.(integer->char (string->number token 8)).

If token is C-, c-, or ^ followed by a character, then this syntax is read as a control character. If token is M- or m- followed by a character, then a meta character is read. c- and m- prefixes may be combined.

— Read syntax: #+ feature form

If feature is provided? then form is read as a scheme expression. If not, then form is treated as whitespace.

Feature is a boolean expression composed of symbols and and, or, and not of boolean expressions.

For more information on provided?, See Require.

— Read syntax: #- feature form

is equivalent to #+(not feature) expression.

— Read syntax: #| any thing |#

Is a balanced comment. Everything up to the matching |# is ignored by the read. Nested #|...|# can occur inside any thing.

Load sytax is Read syntax enabled for read only when that read is part of loading a file or string. This distinction was made so that reading from a datafile would not be able to corrupt a scheme program using ‘#.’.

— Load syntax: #. expression

Is read as the object resulting from the evaluation of expression. This substitution occurs even inside quoted structure.

In order to allow compiled code to work with #. it is good practice to define those symbols used inside of expression with #.(define ...). For example:

          #.(define foo 9)                        ⇒ #<unspecified>
          '(#.foo #.(+ foo foo))                  ⇒ (9 18)
— Load syntax: #' form

is equivalent to form (for compatibility with common-lisp).