One of my favorite small things about Racket is that is permits almost
anything to be an identifier -- allowing you to use whatever natural
names you prefer.
In addition to Unicode, identifiers can start with a number:
(define 100-continue? "✓")
In the rare case where an identifier wouldn't be valid, you can use it
anyway inside pipe chars:
(define |identifier with spaces| "✓")
(But it would be idiomatic to use `identifier-without-spaces`.)
You can even use identifiers that are entirely some number of spaces:
(define | | "one space")
(define | | "two spaces")
(equal? | | | |) ;#f
Which I suppose can be a nutritious part of a code obfuscation diet. :)
One gotcha, which I remember confusing myself with, early on:
(define 'foo "foo")
Huh? That's because 'foo is reader shorthand for (quote foo). So the
above is actually:
(define (quote foo)
In other words, it defines `quote` as a constant function that always
returns "foo". Definitions in a module shadow those provided by the
module's language -- in this case the `quote` provided by racket.
(Definitions provided by a `require`d module, however, can't be
shadowed -- that's a redefinition error.)
You received this message because you are subscribed to the Google Groups
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
For more options, visit https://groups.google.com/d/optout.