On Thu, 27 Nov 2003, Mathieu Bouchard wrote:

# 
# On Tue, 25 Nov 2003, David A. Black wrote:
# 
# > eval is not for constructing code piecemeal with various variables.
# > eval is for evaluating strings as code at runtime.
# 
# A classic of evaluating strings is evaluating SQL code, and almost
# invariably it involves inserting into a SQL code string some values coming
# from the surrounding language. Those values must be converted
# appropriately and safely, e.g. strings must be properly quoted. Then the
# "?" placeholder has been introduced specially for that purpose.
# 
# In this case, it's almost the same situation, but about embedding Ruby
# code into Ruby code.
# 

There's a big conceptual difference between what is happening with SQL and 
what is happening when you eval something.  I view the SQL scenario as 
being not much different than any other interpreter.Part of the difference 
is host/eval language differences (do you ever eval SQL inside an engine 
which is written in SQL?) but more importantly, eval'ing is generally 
(including the case of Ruby, something that is delegated from one piece of 
code back up to the engine which parsed itself.  I don't see this as being 
related, but it's possible that I'm missing something.

Chad