20 points · by brudgers · 11y ago · 4 comments
[1]: http://practical-scheme.net/gauche/man/gauche-refe_5.html#St...
[2]: http://practical-scheme.net/gauche/man/gauche-refe_48.html#K...
For example:
gosh> :key
:key
gosh> (define :key 5)
*** ERROR: Compile Error: syntax-error: (define :key 5)
"(stdin)":2:(define :key 5)
Stack Trace:
_______________________________________The trick is:
- There'll be a "keyword" module that conceptually binds and exports all possible names beginning with ':'. Each name is bound to itself.
- The keyword module is implicitly visible to Gauche native programs (inheriting "gauche" module). So, the identifiers beginning with ':' behaves as if they're keywords, unless you rebinds them explicitly.
- From vanilla R7RS, nothing is special with identifier beginning with ':'. You can import the keyword module to make it behave like keywords.