Version 2 of When is a good time to use eval?

Updated 2005-04-28 15:58:51

eval (itself properly seen as a specialization of uplevel) is a powerful Tcl command. Beginning programmers often regard it rather magically, though, and are susceptible to bad habits in its use. Let's straighten those out here:

First, dense eval-ing often is a symptom of misunderstanding [L1 ], generally of the "working too hard" variety. Also, eval has security implications [explain], so it's appropriate systematically to analyze each instance of an eval in any particular application, and explicitly review that they're all "material".

...