Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
It's really not bad style to write code with side effects (depending, I suppose, on your precise definition thereof). Of course, it's (usually) bad style to write code with random, unpredictable, or unclear side effects, just as in any language. But look in any well-regarded Lisp book like Norvig or one of Graham's and you'll see side effects, setfs, etc. It'd be hard to use CLOS, for example, without them. If one's intent is to use primarily the functional features of Lisp, then I guess I agree, but in practice, one uses the imperative and OO features just as much, it seems. You're spot on about eval, though. Oh, one other thing. For the code to do what (I guess) is actually desired, one needs to quote the form to be evaled:
As originally written, both closure and z would be set to 4, and the eval form would simply eval 4 to get 4 In reply to Re: Re (tilly) 1: Lisp is More Evaluatable
by hding
|
|