Talk:Eval

From Wikipedia, the free encyclopedia

Does Lua have "eval-functionality"? (I just glanced at the docs: http://www.lua.org/manual/5.1/manual.html#2.4.1 : "The unit of execution of Lua is called a chunk...A chunk may be stored in a file or in a string inside the host program" ) teadrinker 23:20, 3 March 2006 (UTC)

Yes, you can load and execute any string or file in Lua. The result is a "chunk" (or function in other words). For example:
myFunc = loadstring(aCodeString)
myFunc()
or just:
loadstring(aCodeString)() --Loading and executing string at once
--Zigmar 19:29, 13 July 2006 (UTC)

This article was previously nominated for deletion. The deletion result was moved to here, and has been removed to: Wikipedia:Articles for deletion/Eval --AllyUnion (talk) 03:34, 30 September 2005 (UTC)

[edit] Python section

The python section claims that python cannot evaluate statements, only functions. Then the two example show calling eval for statements.

What gives?

Dubwai 15:43, 29 December 2006 (UTC)

I missed that there's a distinction between exec and eval. Ignore.

Dubwai 16:46, 29 December 2006 (UTC)