![]() | This article is rated Start-class on Wikipedia's
content assessment scale. It is of interest to the following WikiProjects: | ||||||||||||||||||||||||||||||
|
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)
myFunc = loadstring(aCodeString) myFunc()
loadstring(aCodeString)() --Loading and executing string at once
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)
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)
The link "Jonathan Johnson on exposing classes to RBScript" looks suspiciously self-promotional to me. Before I included the link to Python documentation, it was the only external link in this article, and it mentions "Jonathan Johnson" as if he is some kind of Computer Science authority (reading his blog you do find out he works for the company that makes RealBasic). If you are reading this, and you agree that it is self-promotion, do erase the link. -- Ramalho 03:46, 7 April 2007 (UTC)
Perhaps it would be better to demonstrate an example of using eval on a callback situation, since it's a legitimate use.
Azraell Zanella 01:11, 18 July 2007 (UTC)
This article doesn't quite ever mention that eval and apply are related in a yin and yang fashion: in order to (eval '(f x)) your system must make the critical step (apply f x) to get the actual result. To be clear: the code must convert the string f to a callable function f, and then must apply the callable function f to its arguments! Unfortunately, the article on apply says almost nothing about the computer-sciene meaning of this idea. linas ( talk) 07:30, 23 November 2007 (UTC)
The mail merge example shown is unnecessarily using eval
to return the contents of a string variable to the print
function. Unless eval
has some effect that I'm just not seeing, that code fragment is a bad example for eval use (the last line could just as easily be written as "print $template;
").
This is not The Daily WTF. -- Btx40 ( talk) 16:44, 3 July 2008 (UTC)
typing eval( into the text field on 4chan will get you a week long ban
though it was worth mentioning —Preceding unsigned comment added by 213.107.10.216 ( talk) 22:15, 3 June 2009 (UTC)
it takes you to the invasion board —Preceding unsigned comment added by 204.112.224.180 ( talk) 21:58, 22 February 2010 (UTC)
JavaScript doesn't require semicolons in any code (though it's bad style to leave them off). Why make special mention of eval letting one leave off the final semicolon? Same goes for any other languages that insert missing semicolons. —Preceding unsigned comment added by 72.174.169.239 ( talk) 00:13, 3 September 2010 (UTC)
The link in references to D's eval function seems dead. Should be updated. — Preceding unsigned comment added by 165.123.202.137 ( talk) 18:26, 1 March 2014 (UTC)
Hello fellow Wikipedians,
I have just modified 2 external links on Eval. Please take a moment to review my edit. If you have any questions, or need the bot to ignore the links, or the page altogether, please visit this simple FaQ for additional information. I made the following changes:
When you have finished reviewing my changes, you may follow the instructions on the template below to fix any issues with the URLs.
This message was posted before February 2018.
After February 2018, "External links modified" talk page sections are no longer generated or monitored by InternetArchiveBot. No special action is required regarding these talk page notices, other than
regular verification using the archive tool instructions below. Editors
have permission to delete these "External links modified" talk page sections if they want to de-clutter talk pages, but see the
RfC before doing mass systematic removals. This message is updated dynamically through the template {{
source check}}
(last update: 5 June 2024).
Cheers.— InternetArchiveBot ( Report bug) 10:53, 25 September 2017 (UTC)
@
Diego Moya: According to this Wikipedia article, eval
and apply
are
"instances of meta-circular evaluators." Are there any reliable sources that can verify this?
Jarble (
talk)
19:50, 4 November 2021 (UTC)
In more than 20 years of using Perl, I have found eval
most useful for creating variables. I propose adding the following paragraph in the Perl section in the article.
I could add a specific example with Perl code if that would be deemed helpful.
In
Perl (and perhaps other languages mentioned in this article),
eval
can be used to create Perl variables.
[1]
Ravn007 (
talk)
17:36, 18 November 2021 (UTC)
![]() | This article is rated Start-class on Wikipedia's
content assessment scale. It is of interest to the following WikiProjects: | ||||||||||||||||||||||||||||||
|
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)
myFunc = loadstring(aCodeString) myFunc()
loadstring(aCodeString)() --Loading and executing string at once
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)
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)
The link "Jonathan Johnson on exposing classes to RBScript" looks suspiciously self-promotional to me. Before I included the link to Python documentation, it was the only external link in this article, and it mentions "Jonathan Johnson" as if he is some kind of Computer Science authority (reading his blog you do find out he works for the company that makes RealBasic). If you are reading this, and you agree that it is self-promotion, do erase the link. -- Ramalho 03:46, 7 April 2007 (UTC)
Perhaps it would be better to demonstrate an example of using eval on a callback situation, since it's a legitimate use.
Azraell Zanella 01:11, 18 July 2007 (UTC)
This article doesn't quite ever mention that eval and apply are related in a yin and yang fashion: in order to (eval '(f x)) your system must make the critical step (apply f x) to get the actual result. To be clear: the code must convert the string f to a callable function f, and then must apply the callable function f to its arguments! Unfortunately, the article on apply says almost nothing about the computer-sciene meaning of this idea. linas ( talk) 07:30, 23 November 2007 (UTC)
The mail merge example shown is unnecessarily using eval
to return the contents of a string variable to the print
function. Unless eval
has some effect that I'm just not seeing, that code fragment is a bad example for eval use (the last line could just as easily be written as "print $template;
").
This is not The Daily WTF. -- Btx40 ( talk) 16:44, 3 July 2008 (UTC)
typing eval( into the text field on 4chan will get you a week long ban
though it was worth mentioning —Preceding unsigned comment added by 213.107.10.216 ( talk) 22:15, 3 June 2009 (UTC)
it takes you to the invasion board —Preceding unsigned comment added by 204.112.224.180 ( talk) 21:58, 22 February 2010 (UTC)
JavaScript doesn't require semicolons in any code (though it's bad style to leave them off). Why make special mention of eval letting one leave off the final semicolon? Same goes for any other languages that insert missing semicolons. —Preceding unsigned comment added by 72.174.169.239 ( talk) 00:13, 3 September 2010 (UTC)
The link in references to D's eval function seems dead. Should be updated. — Preceding unsigned comment added by 165.123.202.137 ( talk) 18:26, 1 March 2014 (UTC)
Hello fellow Wikipedians,
I have just modified 2 external links on Eval. Please take a moment to review my edit. If you have any questions, or need the bot to ignore the links, or the page altogether, please visit this simple FaQ for additional information. I made the following changes:
When you have finished reviewing my changes, you may follow the instructions on the template below to fix any issues with the URLs.
This message was posted before February 2018.
After February 2018, "External links modified" talk page sections are no longer generated or monitored by InternetArchiveBot. No special action is required regarding these talk page notices, other than
regular verification using the archive tool instructions below. Editors
have permission to delete these "External links modified" talk page sections if they want to de-clutter talk pages, but see the
RfC before doing mass systematic removals. This message is updated dynamically through the template {{
source check}}
(last update: 5 June 2024).
Cheers.— InternetArchiveBot ( Report bug) 10:53, 25 September 2017 (UTC)
@
Diego Moya: According to this Wikipedia article, eval
and apply
are
"instances of meta-circular evaluators." Are there any reliable sources that can verify this?
Jarble (
talk)
19:50, 4 November 2021 (UTC)
In more than 20 years of using Perl, I have found eval
most useful for creating variables. I propose adding the following paragraph in the Perl section in the article.
I could add a specific example with Perl code if that would be deemed helpful.
In
Perl (and perhaps other languages mentioned in this article),
eval
can be used to create Perl variables.
[1]
Ravn007 (
talk)
17:36, 18 November 2021 (UTC)