How to reason about it
- Integer:
-?(0|[1-9][0-9]*); rational: integer numerator over positive canonical denominator; real requires fraction or exponent. - Dotted-list placement, escape spelling, byte range, and delimiter closure are checked before normalization.
- Strings spell a hexadecimal scalar as
\xHEX;; characters spell it as#\xHEXwithout the semicolon. - Source spans use the reader input identity and deterministic positions.
Pinned token grammar
| Token | Accepted shape | Rejected boundary |
|---|---|---|
| integer | -?(0|[1-9][0-9]*) | leading zero, radix/exactness prefix |
| rational | <integer>/[1-9][0-9]*; reduced after read | zero/negative denominator spelling, leading-zero denominator |
| real | decimal with fraction and/or exponent | bare integer ambiguity, non-finite literal |
| string | quoted UTF-8 with pinned escapes, including \xHEX; | unterminated escape or missing hexadecimal semicolon |
| character | #<scalar>, #\xHEX, or pinned named form | invalid scalar or a semicolon after the hexadecimal character |
| bytevector | #u8(<byte> ...) | element outside 0..255 |
The named characters are exactly space, newline, linefeed, tab,
return, null, nul, delete, rubout, escape, esc, backspace,
alarm, and page. Line comments begin with ;; block comments use nested
#| ... |#; a leading ;! header is preserved. #; datum comments and
#lang directives are rejected with E120, not discarded as trivia.
A common mistake
Reader extensions not listed in the profile fail loudly.
Keep going
Use this page while writing code. For a guided explanation, return to the syntax map or the corresponding manual.