[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Eval - Pro's and Con's (was Re: Dylan rather than CL -- why?)
- To: dyer@eagle.sharebase.com
- Subject: Eval - Pro's and Con's (was Re: Dylan rather than CL -- why?)
- From: Stavros Macrakis <macrakis@osf.org>
- Date: Mon, 7 Dec 1992 16:28:25 -0500
- Cc: john@linus.mitre.org, info-dylan@cambridge.apple.com
- In-reply-to: Scot Dyer's message of Mon, 7 Dec 92 11:07:05 PST <9212071907.AA15766@eagle.sharebase.com>
- Sender: macrakis@osf.org
Moon's note was pretty laconic, but the basic problem here is indeed
that you are confusing "read" and "eval". The expression
(eval '(+ 1 2))
is the same as
(eval (read "(+ 1 2)"))
because read is being used to read the program. You can presume that
there will be some syntax for "quote" in an infix syntax as well.
Suppose this syntax is << ... >>. Then
eval(<<1 + 2>>)
would be the same as
eval(algol-read("1+2")).
If of course you want to mix quoted expression syntax and language
syntax, you will simply have to use the appropriate "read" function.
Thus, you'd have for instance:
(eval (algol-read "1+2"))
and
eval(read("(+ 1 2)")).
There is no problem here at all.
As for:
There aren't many applications for eval, I'll give you that. There
are probably even less with an Algol style grammer...
There are legitimate applications for eval, and they have absolutely
nothing to do with the syntax of the language. Perhaps you are
confusing syntax with the ability to manipulate syntax trees as data
structures? Most language systems do not give you this capability,
but there's nothing inherent about it.
-s