<i>GOO</i> Manual -- Lexical Structure

|  |  | Lexical Structure

## Lexical Structure

The lexical structure is mostly the same as Scheme [3] with the notable exceptions being that identifiers can start with numeric digits if they are clearly distinguishable from floating point numbers and no syntax is provided for specifying improper lists. Furthermore, vertical bars are tokenized immediately and separately and have special meaning within lists, providing syntactic sugar for typed variables.

The following is a very brief and incomplete description of how characters are tokenized into s-expressions, where s-expressions are either tokens or lists of s-expressions:

`; ...` | `Line comment` | `N`
`#/ ... /#` | `Nested comment` | `N`
`. + - [0-9]+` | `Number` | `N`
`#e #i #b #o #d #x` | `Special number` | `N`
`#t #f` | `Logical` | `N`
`#\name` | `Character` | `N`
`[a-zA-Z0-9]+` | `Identifier` | `N`
`( ... )` | `List` | `N`
`#( ... )` | `Tuple` | `N`
`#[ ... ]` | `Vector` | `N`
`" ... "` | `String` | `N`
`\c` | `Special character's within strings` | `N`
`x|t` | `Typed variable within list == `(x t)`.` | `N`
`#|` | `Escaped vertical bar.` | `N`
`{ ... }` | `Lightweight function syntax.` | `N`
`'[' ... ']'` | `Collection indexing and slicing.` | `N`

|  |  | Lexical Structure