Talk:Runtime evaluation/In an environment: Difference between revisions

Content added Content deleted
m (→‎Why marked as incorrect?: added some ?? to stress that they are not final sentences, but "doubts"; it is enough to "embed everything" into a func then??)
(reply)
Line 8: Line 8:


What about? --[[User:ShinTakezou|ShinTakezou]] 00:06, 30 April 2009 (UTC)
What about? --[[User:ShinTakezou|ShinTakezou]] 00:06, 30 April 2009 (UTC)

The first point means that you're not supposed to write e.g. (in JavaScript) eval("function (x) { return " + providedSourceCode + "}") (unless there is no other way). It does *not* mean that the parameter should be a block/closure/function object; the reason I didn't write "string" is to allow for parsed-but-not-evaluated code objects such as exists in E and Lisp.

x should not be global in the sense that the values given to it are visible to code ''other'' than the code being evaluated. In the Perl example, the variable is made local (lexical) by <code>my</code>; in the PHP example I (perhaps mistakenly) assumed that an undeclared variable is global. If that is wrong, please delete the flag on the PHP example. --[[User:Kevin Reid|Kevin Reid]] 02:01, 30 April 2009 (UTC)