Thread: Readding eval()
View Single Post
  #19  
Old 03-19-2007, 08:17 PM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
Quote:
Originally Posted by Stefan View Post
Ah examples please, there are several ideas of eval which seem to be quite different (some refer to eval as something that solves "1 + 2" or so). Also there was never an eval() function in Graal so I need some examples where you need it.
I think they are thinking along the lines of PHP's eval, where the passed string parameter is parsed as script commands or so. Here is a PHP example:
PHP Code:
eval("$magicVariableName = \"SomeValue\"; thisFunction();"); 
Return values are also passed through eval in PHP:
PHP Code:
echo(eval("return \"foo\";")); 
... would produce "foo".
__________________
Skyld
Reply With Quote