CSC/ECE 517 Fall 2010/ch3 3e br: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
=eval()= | |||
==Introduction== | ==Introduction== | ||
The eval facility is one of the most powerful features of Ruby (as well as other dynamic languages). | The eval facility is one of the most powerful features of Ruby (as well as other dynamic languages). | ||
Line 7: | Line 8: | ||
and compare it with similar mechanisms in other languages. | and compare it with similar mechanisms in other languages. | ||
== | ==Origin== | ||
[http://en.wikipedia.org/wiki/Lisp_%28programming_language%29] | |||
==Security risks== | |||
[http://en.wikipedia.org/wiki/Eval] | |||
==Context== | |||
==Implementation== | |||
===Dynamic Programming Languages=== | |||
====Lisp==== | |||
====Perl==== | |||
====Ruby==== | |||
====JavaScript==== | |||
====PHP==== | |||
====Python==== | |||
====ColdFusion==== | |||
===Static Programming Languages=== | |||
====Java=== | |||
GroovyShell | |||
===Command Line interpreters=== | |||
<ref>[http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-26.html The Metacircular Evaluator] | <ref>[http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-26.html The Metacircular Evaluator] | ||
Revision as of 13:29, 3 October 2010
eval()
Introduction
The eval facility is one of the most powerful features of Ruby (as well as other dynamic languages). Kernel.eval method will parse and execute an arbitrary string of legal Ruby source code. To put it plainly, if your Ruby program can generate a string of valid Ruby code, the Kernel.eval method can evaluate that code. The eval facility gives developers the ability to modify the runtime behavior of program. Illustrate the practical advantages of Ruby's eval(...) and compare it with similar mechanisms in other languages.
Origin
Security risks
Context
Implementation
Dynamic Programming Languages
Lisp
Perl
Ruby
JavaScript
PHP
Python
ColdFusion
Static Programming Languages
=Java
GroovyShell
Command Line interpreters
<ref>The Metacircular Evaluator
References
[3] Introducing Bazaar. Retrieved September, 2010.
[4] Aran, A Brief History of Version Control Systems. Retrieved September, 2010.