Why exactly is eval evil?

前端 未结 12 1477
没有蜡笔的小新
没有蜡笔的小新 2020-11-22 09:51

I know that Lisp and Scheme programmers usually say that eval should be avoided unless strictly necessary. I’ve seen the same recommendation for several program

12条回答
  •  花落未央
    2020-11-22 10:18

    There have been many great answers but here is another take from Matthew Flatt, one of the implementers of Racket:

    http://blog.racket-lang.org/2011/10/on-eval-in-dynamic-languages-generally.html

    He makes many of the points that have already been covered but some people may find his take interesting nonetheless.

    Summary: The context in which it's used affects the result of eval but is often not considered by programmers, leading to unexpected results.

提交回复
热议问题