[racket] Racketrivia: Using ' as an identifier suffix

From: Neil Van Dyke (neil at neilvandyke.org)
Date: Thu Jan 8 16:49:01 EST 2015

I generally recommend against using non-ASCII characters in Racket 
source code.

Besides the human readability question (and the searchability question), 
non-ASCII still presents a significant risk of your characters getting 
corrupted "in transmission".  Especially with all the Web sites and 
other network services through which code might be presented and 
copy&pasted.  It's still not uncommon for a site/service to send 
non-ASCII characters under the wrong encoding labeling, and you'll even 
see services that map problematic Unicode characters (e.g., special 
spaces, dashes, quotes) to ASCIII.

One forgivable exception to ASCII-only is if you want to be cute in code 
examples in an academic paper.  Although you can still run into 
transmission problems, when people copy&paste code, and when your PDFs 
are translated to a different format.

Then there is the cute lambda character, which has become a special 
case, since it's been adopted by some Racket developers.  I think some 
of the appeal of that might go away if there were a more terse lambda 
syntax.  Maybe just make `fn` an alias for `lambda`.  (nd, as an old 
programmer friend (who was generally impressed when I explained Scheme's 
first-class closures to him) remarked, "They actually type out the word 
'lambda'?  That's *so precious*."  I've actually grown to find typing 
out `lambda` to be tolerable, but if people are going to use a more 
terse alias, `fn` is not problematic like the lambda character.

Neil V.


Posted on the users mailing list.