Keyword syntax

Keywords are self-evaluating identifiers (except in Racket and Kawa, see below) that look like :foo, foo:, or #:foo, depending on the Scheme implementation:

Note: Chez and CL use #: not for keywords but for uninterned symbols.

If we adopt the :foo style, Gauche, Bigloo, S7, STklos will work out of the box, and Chicken will support it with an option.

If we adopt the foo: style, Gambit, Chicken, STklos, Bigloo, S7 will work out of the box, and Guile, Kawa will support it with an option.

If we adopt the #:foo style, Chicken, Guile, S7, and to some extent Racket and Kawa will work out of the box.

Tokens consisting only of colons

How is the datum : (one colon) read?

How is the datum :: (two colons) read?

How is the datum ::: (three colons) read?

Keywords and vertical bar notation

TODO

Are keywords symbols?

Keyword objects are symbols in the "KEYWORD" package in Common Lisp. symbol-name drops the : or :: prefix.

Keyword objects are symbols such that symbol->string keeps the : prefix in Gauche.

Keyword objects are symbols such that symbol->string keeps the : prefix or suffix, remembering which one you used, in S7.

Keyword objects are not symbols in Bigloo, Chicken, Gambit, Sagittarius, STklos.


Back to Scheme Surveys

Page source (GitHub)