Next: Syntax, Previous: Eval and Load, Up: The Language [Contents][Index]
Next: Load Syntax, Previous: Lexical Conventions, Up: Lexical Conventions [Contents][Index]
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.
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 in SLIB.
is equivalent to #+(not feature) expression
.
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 ‘#.’.
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)
is equivalent to form (for compatibility with common-lisp).
Next: Documentation and Comments, Previous: Common-Lisp Read Syntax, Up: Lexical Conventions [Contents][Index]
#! is the unix mechanism for executing scripts. See Unix Scheme Scripts for the full description of how this comment supports scripting.
Return integers for the current line and column being read during a load.
Returns the string naming the file currently being loaded. This path
is the string passed to load
, possibly with ‘.scm’
appended.
Next: Modifying Read Syntax, Previous: Load Syntax, Up: Lexical Conventions [Contents][Index]
Returns the documentation string of proc if it exists, or
#f
if not.
If the body of a lambda
(or the definition of a procedure) has
more than one expression, and the first expression (preceeding any
internal definitions) is a string, then that string is the
documentation string of that procedure.
(procedure-documentation (lambda (x) "Identity" x)) ⇒ "Identity" (define (square x) "Return the square of X." (* x x)) ⇒ #<unspecified> (procedure-documentation square) ⇒ "Return the square of X."
Appends string1 … to the strings given as arguments to
previous calls comment
.
Returns the (appended) strings given as arguments to previous calls
comment
and empties the current string collection.
Behaves as (comment "text-till-end-of-line")
.
Previous: Documentation and Comments, Up: Lexical Conventions [Contents][Index]
If a # followed by a character (for a non-standard syntax) is
encountered by read
, read
will call the value of the
symbol read:sharp
with arguments the character and the port being
read from. The value returned by this function will be the value of
read
for this expression unless the function returns
#<unspecified>
in which case the expression will be treated as
whitespace. #<unspecified>
is the value returned by the
expression (if #f #f)
.
Dispatches like read:sharp
, but only during load
s. The
read-syntaxes handled by load:sharp
are a superset of those
handled by read:sharp
. load:sharp
calls
read:sharp
if none of its syntaxes match c.
If the sequence #\ followed by a non-standard character name is
encountered by read
, read
will call the value of the
symbol char:sharp
with the token (a string of length at
least two) as argument. If the value returned is a character, then that
will be the value of read
for this expression, otherwise an error
will be signaled.
Note When adding new # syntaxes, have your code save the
previous value of load:sharp
, read:sharp
, or
char:sharp
when defining it. Call this saved value if an
invocation’s syntax is not recognized. This will allow #+
,
#-
, and Uniform Arrays to still be supported (as they
dispatch from read:sharp
).
Next: Syntax, Previous: Eval and Load, Up: The Language [Contents][Index]