[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: firstname.lastname@example.org
- Subject: Eval - Pro's and Con's (was Re: Dylan rather than CL -- why?)
- From: Stavros Macrakis <email@example.com>
- Date: Mon, 7 Dec 1992 16:28:25 -0500
- Cc: firstname.lastname@example.org, email@example.com
- In-reply-to: Scot Dyer's message of Mon, 7 Dec 92 11:07:05 PST <9212071907.AA15766@eagle.sharebase.com>
- Sender: firstname.lastname@example.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
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"))
eval(read("(+ 1 2)")).
There is no problem here at all.
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.