Runtime evaluation: Difference between revisions

Content added Content deleted
(→‎{{header|Lua}}: Add note about Lua 5.2 load function)
Line 588: Line 588:


two = loadstring"return ..." -- two() returns the arguments passed to it</lang>
two = loadstring"return ..." -- two() returns the arguments passed to it</lang>

In Lua 5.2 the <code>loadstring</code> function is superseded by the more general <code>load</code> function, which can be used in a compatible way. Nevertheless, <code>loadstring</code> is still available.

{{works with|Lua|5.2}}

<lang lua>f = load("return 42")
f() --> returns 42</lang>


=={{header|JavaScript}}==
=={{header|JavaScript}}==