Jump to content

Talk:Eval: Difference between revisions

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
Content deleted Content added
SineBot (talk | contribs)
Line 61: Line 61:


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. <span style="font-size: smaller;" class="autosigned">—Preceding [[Wikipedia:Signatures|unsigned]] comment added by [[Special:Contributions/72.174.169.239|72.174.169.239]] ([[User talk:72.174.169.239|talk]]) 00:13, 3 September 2010 (UTC)</span><!-- Template:UnsignedIP --> <!--Autosigned by SineBot-->
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. <span style="font-size: smaller;" class="autosigned">—Preceding [[Wikipedia:Signatures|unsigned]] comment added by [[Special:Contributions/72.174.169.239|72.174.169.239]] ([[User talk:72.174.169.239|talk]]) 00:13, 3 September 2010 (UTC)</span><!-- Template:UnsignedIP --> <!--Autosigned by SineBot-->

== Reference to D language is dead ==

The link in references to D's eval function seems dead. Should be updated.

Revision as of 18:26, 1 March 2014

WikiProject iconComputing Unassessed
WikiProject iconThis article is within the scope of WikiProject Computing, a collaborative effort to improve the coverage of computers, computing, and information technology on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
???This article has not yet received a rating on Wikipedia's content assessment scale.
???This article has not yet received a rating on the project's importance scale.
Please add {{WikiProject banner shell}} to this page and add the quality rating to that template instead of this project banner. See WP:PIQA for details.
WikiProject iconComputer science Start‑class Low‑importance
WikiProject iconThis article is within the scope of WikiProject Computer science, a collaborative effort to improve the coverage of Computer science related articles on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
StartThis article has been rated as Start-class on Wikipedia's content assessment scale.
LowThis article has been rated as Low-importance on the project's importance scale.
Things you can help WikiProject Computer science with:

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)[reply]

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)[reply]

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)[reply]

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)[reply]

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

Dubwai 16:46, 29 December 2006 (UTC)[reply]

Jonathan Johnson

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)[reply]

Callback

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)[reply]

apply yin and yang

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)[reply]

Never mind, I added a breif paragraph. The theoretically inclined are invited to expand the article on apply. linas (talk) 18:54, 24 November 2007 (UTC)[reply]

Mail merge example

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)[reply]

4chan

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)[reply]

Hey

it takes you to the invasion board —Preceding unsigned comment added by 204.112.224.180 (talk) 21:58, 22 February 2010 (UTC)[reply]

Do we need to mention semicolon treatment when it's not just true in eval?

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)[reply]

Reference to D language is dead

The link in references to D's eval function seems dead. Should be updated.