Re: Lisp variables, was Example interpreter C

Laurence Finston <lfinsto1@gwdg.de>
22 Sep 2005 23:40:03 -0400

          From comp.compilers

Related articles
[2 earlier articles]
Re: Example interpreter C lfinsto1@gwdg.de (Laurence Finston) (2005-08-21)
Re: Example interpreter C gneuner2@comcast.net (George Neuner) (2005-08-24)
Re: Example interpreter C lfinsto1@gwdg.de (Laurence Finston) (2005-09-07)
Re: Example interpreter C boldyrev+nospam@cgitftp.uiggm.nsc.ru (Ivan Boldyrev) (2005-09-10)
Re: Example interpreter C lfinsto1@gwdg.de (Laurence Finston) (2005-09-14)
Re: Example interpreter C boldyrev@uiggm.nsc.ru (Ivan Boldyrev) (2005-09-17)
Re: Lisp variables, was Example interpreter C lfinsto1@gwdg.de (Laurence Finston) (2005-09-22)
Re: Lisp variables, was Example interpreter C der_julian@web.de (Julian Stecklina) (2005-09-25)
| List of all articles for this month |

From: Laurence Finston <lfinsto1@gwdg.de>
Newsgroups: comp.compilers
Date: 22 Sep 2005 23:40:03 -0400
Organization: GWDG, Goettingen
References: 05-08-055 05-08-062 05-08-073 05-08-084 05-09-025 05-09-036 05-09-051 05-09-066
Keywords: Lisp

On Sat, 17 Sep 2005, Ivan Boldyrev wrote:


> GCL is bad example: it is not standard-conforming :)


Thanks for the information. If I ever document this, I won't call it
"LISP-like behavior". However, it is the behavior that I would
implement, if were to go back and rewrite my grammar. I'm sorry to
hear that this behavior doesn't conform to the LISP standard. I found
it very convenient.


In GNU 3DLDF, as in Metafont, this does work for variables of
type `numeric':


      lfinsto1> 3dldf


      [...]


      * a := 324.54;
      * show a;
      >> 324.54
      * numeric a;
      * show a;
      >> 0


The declaration of `a' as a `numeric' wipes out the old value.
The behavior in Metafont is slightly different in that an unknown
`numeric' doesn't have any value. In 3DLDF, it's not really
unknown once it's been named.


I think it would have been perfectly easy to implement the same behavior
for other data types: `points', `transforms', `paths', etc. I'm not sure
how easy it would be to change it after the fact, though.


The arguments I know of against this behavior are stylistic, and I
disagree with them. I know of no technical reason for not implementing
it.


Laurence Finston


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.