The grammar of an defn-or-expr is similar to the expander’s grammar of fully expanded expressions (see Fully Expanded Programs) ...
In Fully Expanded Programs) though, I feel like the syntax for an id is missing. I understand this is a tiny detail but actually for a long time I thought ids couldn't start with a number until I saw I could write 1/xpto as an id. What's possible? Is any sequence of graphical chars until a space or paren, an id?
Section 1.2.2 of the Reference (1.2 Syntax Model) says that "an identifier is represented as a syntax object containing a symbol." The rules for symbols are given in Section 3.6 of the Racket Guide (3.6 Symbols). I agree that the documentation should be clearer about this.
In linklets, an id is a symbol. Any string can be a symbol, since you can use | to escape arbitrary characters. That symbol is transmitted as-is through the linklet process. Here's an example of running a program that uses a single space as an identifier.
I think I would just say that it can be any symbol, and symbols can have arbitrary strings as their content. The use of | is part of the printer, not the symbol itself.
I think it can be a useful feature, especially considering that other kinds of #langs may have very different requirements for what is allowed as a valid identifier, it is useful to have an underlying implementation language that can use pretty much everything.
(Imagine having to mangle/encode/decode your dsl identifiers to/from a very specific narrow set of allowed identifiers in the implementation language, personally I would find that more annoying)
Another case where it was useful for me is in the syntax-class that is used for a name mapping in define-attributes there an empty symbol is used for the case when you want to "drop" the name, making the implementation simpler.
(define-attributes ([l]) vec3- (x y z)) ;; x y z is bound to (vec3-x l) (vec3-y l) (vec3-z l)
Looking a bit closer at this, what sort of syntax is that \x20;? I assume something starting with \x and ending with ; has some special meaning ? Although I can't find anything in the docs.
I guess that's a matter of preference. For someone who works on C/C++ compilers, name mangling/demangling is just accepted so I guess my views here are biased.