[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.1 Lexical structure

Gauche extends R5RS Scheme parser in some ways:

Nested block comments (SRFI-30)
A text surrounded by '#|' and '|#' becomes a comment. It can be nested.

Numeric literals
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. Using '#' as insignificant digits is not supported.

Symbol names
Symbol names are case sensitive by default (See section 2.3 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 6.5 Symbols, for details.

Character literal by character code
Character literals can be written using its code, by #\xNN (Gauche internal code) or #\uNN (Unicode). See section 6.8 Characters, for details.

Extended sharp syntax
Many more special tokens begins with '#' is defined. See the table below.

The table below lists sharp-syntaxes.

#! [SRFI-22] Specifies interpreter at the beginning of file. Scheme loader ignores the line.
#", ##, #$, #%, #&, #' Unused.
#( [R5RS] Introduces a vector.
#) Unused.
#* If followed by a double quote, denotes an incomplete string. See section 6.10 Strings.
#+ Unused.
#, [SRFI-10] Introduces reader constructor syntax.
#-, #. Unused.
#/ Introduces a literal regular expression. See section 6.11 Regular expression.
#0 ... #9 Reserved for shared structure reference.
#:, #; Unused
#< Introduces an unreadable object.
#=, #> Unused.
#? Introduces debug macros. See section 3.3 Debugging.
#@ Unused.
#a Unused.
#b [R5RS] Binary number prefix.
#c Unused.
#d [R5RS] Decimal number prefix.
#e [R5RS] Exact number prefix.
#f [R5RS] Boolean false, or introducing SRFI-4 uniform vector. See section 9.24 gauche.uvector - Uniform vectors.
#g, #h Unused.
#i [R5RS] Inxact number prefix.
#j, #k, #l, #m, #n Unused.
#o [R5RS] Octal number prefix.
#p, #q, #r Unused.
#s [SRFI-4] introducing SRFI-4 uniform vector. See section 9.24 gauche.uvector - Uniform vectors.
#t [R5RS] Boolean true.
#u [SRFI-4] introducing SRFI-4 uniform vector. See section 9.24 gauche.uvector - Uniform vectors.
#v, #w Unused.
#x [R5RS] Hexadecimal number prefix.
#y, #z Unused.
#[ Introduces a literal character set. See section 6.9 Character Set.
#\ [R5RS] Introduces a literal character. See section 6.8 Characters.
#], #^, #_ Unused.
#` Introduces an interpolated string. See section 6.10.4 String interpolation.
#{ Unused.
#| [SRFI-30] Introduces a block comment. Comment ends by matching '|#'.
#}, #~ Unused.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated by Ken Dickey on November, 28 2002 using texi2html