Re: eval use ?
- From: Majorinc, Kazimir <false@xxxxxxxxx>
- Date: Sun, 26 Feb 2006 12:39:19 +0100
In article <ftydnVQaTbKTNZ_ZRVn-sw@xxxxxxxxxxxxx>,
jared@xxxxxxxxxxx says...
Majorinc wrote:
<graphics> would be much better done using functions, not eval. Represent
each formula as a function, and use funcall to evaluate.
.....
Unless you are expecting to symbolicly manipulate the formulas, it would
again be better to represent each as a function.
More usual than not, if one uses formulas as values, he want to
syntactically process them.
Not only can they both be done without eval, they can be done much
clearer, faster, and more naturally without eval.
Eval is very very
rarely useful; it's mainly useful for recreating your own REPL. Other
cases are better off using macros or closures, both of which more
cleanly integrate with the rest of Lisp.
Code=data is the single most important idea of Lisp and EVAL is
what make it possible. Lisp can exist without macros and
closures, but without EVAL it is not Lisp any more. Idea that
macros or closures more cleanly integrate with the rest
suggests me that you didn't understood the whole point.
Lisp is originally meant to be suitable for symbolic
processing, unlike Fortran which is suitable for numerical
processing only. If you process *formulas* as values, then eval
is very natural idea in many cases. If you deeply and
definitely despise idea of formulas as data, then eval is
really useless to you - but in that case, I think you use wrong
language.
.
- Follow-Ups:
- Re: eval use ?
- From: Ivan Boldyrev
- Re: eval use ?
- References:
- eval use ?
- From: newbie
- Re: eval use ?
- From: Majorinc , Kazimir
- Re: eval use ?
- From: M Jared Finder
- eval use ?
- Prev by Date: Re: eval use ?
- Next by Date: lisp compiler
- Previous by thread: Re: eval use ?
- Next by thread: Re: eval use ?
- Index(es):
Relevant Pages
|
|