[racket] Use of map and eval to evaluate symbol in namespace

From: Neil Van Dyke (neil at neilvandyke.org)
Date: Sun Jul 27 16:16:52 EDT 2014

Maybe there should be a periodic public service announcement about not 
using "eval".  This time I will communicate in FAQ format:

Q: How do I use eval?
A: Don't use eval.

Q: But don't so many academic books feature eval prominently, so doesn't 
that mean I should use try to eval?
A: Those books use eval for pedagogic reasons, or because the author is 
enamored of some theoretical appeal of eval, or because the author wants 
to watch the world burn.  Don't use eval.

Q: But, but, but, I am just starting to learn, and eval seems to do what 
I need.
A: Eval is almost certainly not what you want.  Learn how to use the 
other basics effectively.  Don't use eval.

Q: I now am very comfortable with the language, I am aware that I should 
avoid eval in almost all cases, and I can tell you why eval is actually 
the right thing in this highly unusual case.
A: Cool, that's why eval is there.

Neil V.


Posted on the users mailing list.