3 ms·
> The general lesson taken is not that it is dangerous to ever use eval in any class ever, because that is really useful Ah, then this is, at its root, a langu
by ScottBurson 14y ago
> The general lesson taken is not that it is dangerous to ever use eval in any class ever, because that is really useful
Ah, then this is, at its root, a language design deficiency. If there's something useful that can only be accomplished conveniently by calling 'eval' in a library routine whose job is not specifically to evaluate code, then the language needs a better way to do whatever that is.
In the Lisp world we tell people: never, ever call 'eval', the sole exception being that you're writing an interpreter. It is sound advice. Unless you're intentionally writing an interpreter, there is a better way to accomplish whatever you're trying to do.
- ScottBurson 14y agoAh, a downvote. Yeah, I thought this might not be a popular message. I have many years of experience in Lisp, and what I'm telling you is the longstanding consensus among Lisp experts. You should listen to us. Ruby is not so different from Lisp that the lesson is inapplicable. I stand by my comment.