[racket-dev] Style guide: keywords and character conventions

From: Gustavo Massaccesi (gustavo at oma.org.ar)
Date: Tue Jul 16 16:30:01 EDT 2013

Hi! I was reading the draft of the style guide in the file
[plt]/pkgs/racket-pkgs/racket-doc/scribblings/style/textual.scrbl
(link: http://git.racket-lang.org/plt/blob/b2ebb0a28bf8136e75cd98316c22fe54c30eacb2:/pkgs/racket-pkgs/racket-doc/scribblings/style/textual.scrbl
)

In the lines 388 - 348, there is a list of special characters that
mark by convention special kind of symbols. In my opinion, "#:"
doesn't belong to that list, or at least it needs a special remark.

For example, "?" marks predicates, but "one?" is a normal symbol and
nothing in the language forces or assumes that it's a predicate. In
particular "(define one? 5)" is a legal Racket instruction, in spite
it is of extremely bad style.

But "#:" is different. It creates a special kind of data. If I
understand correctly at the kernel level the keyword don't have a
special representation. But at the Racket level there is a reader
extension for #: and write/print/display show the keywords with #: .
And many of the constructs of the language treat the keywords in a
special way, for example lambda, apply, ...

Gustavo

Posted on the dev mailing list.