Is there ever a good reason to use eval()?

后端 未结 10 1072
清歌不尽
清歌不尽 2020-12-03 20:51

It seems to me that eval() is treated with the same disdain that goto is. And by eval, I mean a function for executing a string as code, as seen in

10条回答
  •  -上瘾入骨i
    2020-12-03 21:19

    Offhand thought: eval is good for implementing a poor man's expression compiler, or things like that. It's also a dull, rusty substitute for hygienic macros.

提交回复
热议问题