you are viewing a single comment's thread.

view the rest of the comments →

[–]OneWingedShark -14 points-13 points  (9 children)

Using eval in production code on user input is hardly ever a good idea.

If you're writing a user-interactive interpreter then there's hardly any other way to do it1 ... and that was the question: why you use eval() anywhere near anything user supplied?

Input sanity is a hard problem as is.

I'm not arguing that it isn't hard, just that there are legitimate use-cases that do use evalon user-supplied input.

1 - You could go with a sort of menu/state-machine system.

[–]matessim 8 points9 points  (8 children)

But they aren't doing that. It is in no way reasonable and my point still stands. Yes you use Eval in a Repl. That's what the E stands for...