Re: eval use ?
- From: Majorinc, Kazimir <false@xxxxxxxxx>
- Date: Sun, 26 Feb 2006 03:06:51 +0100
In article <1140929811.970351.270010
@e56g2000cwe.googlegroups.com>, amit_h123@xxxxxxxxxxx says...
hello,
i am just tryin to learn lisp from robert wilensky's common lispcraft.
But i am all stuck at the eval function use ..can somebody help me out
what does exactly eval is used for specially can you give me some
examples of complex code where it is being use.. coz its like i can get
the simpler examples but not gettin it utility for complex thinkgs
where it can be used..
Just two examples from my practice - imagine that you write
screen saver, and you want to write program that calculate and
draw some cute 3d objects on the base of random ... formula.
Now, the problem - how to represent formulas? The simplest
answer is to represent them as expressions in the programming
language and evaluate as needed.
Or, second example - imagine that you want to write program
that process Boolean formulas. How will you represent that
formula? It is best to represent them as Lisp expression and in
that case, from time to time, it will be very handy to simply
EVALuate such formula.
I can describe few other problems from top of my mind. Of
course, all this can be done without EVAL, hey, everything can
be done in C. Just data structures and algorithms one develop
with time start to look like interpreter.
EVAL and whole code=data idea is somehow marginalized and
underdeveloped in Lisp. Scheme has better EVAL than Lisp.
However, representation of code as single linked list was
adequate in 1960's when memory was sparse, but it is kinda
obsolete today.
.
- Follow-Ups:
- Re: eval use ?
- From: M Jared Finder
- Re: eval use ?
- From: Timofei Shatrov
- Re: eval use ?
- References:
- eval use ?
- From: newbie
- eval use ?
- Prev by Date: Re: lisp idiom for processing each line in a file?
- Next by Date: mapcar use.
- Previous by thread: eval use ?
- Next by thread: Re: eval use ?
- Index(es):
Relevant Pages
|
|