| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Gauche extends R5RS Scheme parser in some ways:
A text surrounded by '#|' and '|#' becomes a comment.
It can be nested.
Either integral part or fraction part of inexact real numbers can be omitted
if it is zero, i.e. 30., .25, -.4 are read as
real numbers.
The number reader recognizes '#' as insignificant digits.
Complex numbers can be written both in the rectangular format
(e.g. 1+0.3i) and in the polar format (e.g. 3.0@1.57).
Inexact real numbers include
the positive infinity, the negative infinity, and NaN,
which are represented as +inf.0, -inf.0 and +nan.0,
respectively. (-nan.0 is also read as NaN.)
Symbol names are case sensitive by default (See section Case-sensitivity).
Symbol name can begin with digits, '+' or '-', as long as
the entire token doesn't consist valid number syntax.
Other weird characters can be included in a symbol name by surrounding
it with '|', e.g. '|this is a symbol|'.
See section Symbols, for details.
Character literals can be written using its code,
by #\xNN (Gauche internal code) or #\uNN (Unicode).
See section Characters, for details.
Many more special tokens begins with '#' are defined.
See the table below.
The table below lists sharp-syntaxes.
| [R6RS][SRFI-22] It is either a beginning of an interpreter line (shebang) of a script, or a special token that affects the mode of the reader. See `hash-bang token' section below. |
| Unused. |
| [R5RS] Introduces a vector. |
| Unused. |
| If followed by a double quote, denotes an incomplete string. See section Strings. |
| Unused. |
| [SRFI-10] Introduces reader constructor syntax. |
| Unused. |
| Introduces a literal regular expression. See section Regular expression. |
| [SRFI-38] Shared substructure definition and reference. |
| Unused |
| [SRFI-62] S-expression comment. Reads next one S-expression and discard it. |
| Introduces an unreadable object. |
| Unused. |
| Introduces debug macros. See section Debugging. |
| Unused. |
| Unused. |
| [R5RS] Binary number prefix. |
| Unused. |
| [R5RS] Decimal number prefix. |
| [R5RS] Exact number prefix. |
| [R5RS] Boolean false, or
introducing SRFI-4 uniform vector. See section |
| Unused. |
| [R5RS] Inxact number prefix. |
| Unused. |
| [R5RS] Octal number prefix. |
| Unused. |
| [SRFI-4] introducing SRFI-4 uniform vector. See section |
| [R5RS] Boolean true. |
| [SRFI-4] introducing SRFI-4 uniform vector. See section |
| Unused. |
| [R5RS] Hexadecimal number prefix. |
| Unused. |
| Introduces a literal character set. See section Character Set. |
| [R5RS] Introduces a literal character. See section Characters. |
| Unused. |
| Introduces an interpolated string. See section String interpolation. |
| Unused. |
| [SRFI-30] Introduces a block comment. Comment ends by matching ' |
| Unused. |
A character sequence #! has two completely different
semantics, depending on how and where it occurs.
If a file begins with #!/ or #! (hash, bang, and a
space), then the reader assumes it is an interpreter line (shebang) of
a script and ignores the rest of characters until the end of line.
(Actually the source doesn't need to be a file. The reader checks
whether it is the beginning of a port.)
Other than the above case, #!identifier is read as
a token with special meanings. This kind token can be a special
directive for the reader, instead of read as a datum.
By default, three of such tokens are recognized. #!fold-case
and #!no-fold-case switches the reader's case sensitivity;
#!fold-case makes the reader case insensitive, and
#!no-fold-case makes it case sensitive. (Also see
Case-sensitivity).
The token #!r6rs is introduced in R6RS and used to indicate the
program is strictly conforms R6RS. Gauche doesn't support R6RS, and
currently it issues warning when it sees #!r6rs token, though
it keeps reading on.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] |
This document was generated by Shiro Kawai on October, 7 2008 using texi2html 1.78.