Go to the first, previous, next, last section, table of contents.


[FIXME: need some initial schmooze about keywords; this is all taken from the NEWS file, and is accurate but not very useful to someone who has not used keywords before.]

Guile supports a new R4RS--compliant syntax for keywords. A token of the form #:NAME, where NAME has the same syntax as a Scheme symbol, is the external representation of the keyword named NAME. Keyword objects print using this syntax as well, so values containing keyword objects can be read back into Guile. When used in an expression, keywords are self-quoting objects.

Guile suports this read syntax, and uses this print syntax, regardless of the current setting of the `keyword' read option. The `keyword' read option only controls whether Guile recognizes the `:NAME' syntax, which is incompatible with R4RS. (R4RS says such token represent symbols.)

The default behaviour is the R4RS--compliant one (#:xxx instead of :xxx).

To change between the two keyword syntaxes you use the read-options procedure documented in section General option interface and section Reader options.

To use the :xxx keyword syntax, use

(read-set! keywords 'prefix)

To make keyword syntax R4RS compliant, with the #:xxx syntax, use:

(read-set! keywords #f)

[FIXME: in state of flux right now; here are the Scheme primitives defined in `kw.c':]

primitive: keyword? kw
keyword? returns #t if the argument kw is a keyword; it returns #f otherwise.

primitive: keyword-dash-symbol arg
keyword-dash-symbol [FIXME: have no idea what this does; it is not commented.]

Go to the first, previous, next, last section, table of contents.