One example of eval being used for extremely practical purposes is with SQL. 

Many practical programmers regularly  generate SQL strings which are then 
passed to a remote server, which are then evaluated. Indeed, all the same sorts 
of arguments against eval may be made against SQL:

1. SQL is confusing: it is executed in a completely separate environment, it 
breaks lexical scope, and it has a wildly different everything from the Ruby I 
am used to, so why should we use it?

2. SQL is vulnerable to injection attacks. The programmer must be responsible 
for understanding this and know how to identify and address these faults. But 
why should we use it given these risks?

3. Even if 1 above wasn't true in many ways, it still introduces a layer of 
indirection. Do we really need that?

Yet, SQL seems to enjoy some success. 

I might say: eval is a powerful tool that requires some thoughtful 
consideration, and should be used judiciously. 

Sent from my iPhone

> On Aug 5, 2015, at 7:11 AM, Michael Titke <michael.tied...@o2online.de> wrote:
> 
> 
> 
>> On 04/08/2015 16:34, Alexis King wrote:
>> 
>> And that, I think, is the problem: eval seems a lot like a “one size fits 
>> all” approach to problem solving.
>> ...
>> We write in high-level languages for a reason. There’s no reason to stunt 
>> their ability to abstract by directly calling eval.
> 
> I do understand that attitude of staying on top of a platform and in the 
> "high levels" of a high level language. Exactly for those reasons some have 
> written that pityful subroutine called "eval" and others even maintain it 
> from time to time - just to not get your feets wet ;-) if not for a very good 
> reason.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to