Re: Example interpreter C

Ivan Boldyrev <>
17 Sep 2005 13:49:10 -0400

          From comp.compilers

Related articles
[7 earlier articles]
Re: Example interpreter C (Julian Stecklina) (2005-08-31)
Re: Example interpreter C (Joerg Simon) (2005-09-02)
Re: Example interpreter C (Laurence Finston) (2005-09-07)
Re: Example interpreter C (Ivan Boldyrev) (2005-09-10)
Re: Example interpreter C (George Neuner) (2005-09-10)
Re: Example interpreter C (Laurence Finston) (2005-09-14)
Re: Example interpreter C (Ivan Boldyrev) (2005-09-17)
Re: Lisp variables, was Example interpreter C (Laurence Finston) (2005-09-22)
Re: Lisp variables, was Example interpreter C (Julian Stecklina) (2005-09-25)
| List of all articles for this month |

From: Ivan Boldyrev <>
Newsgroups: comp.compilers
Followup-To: comp.lang.lisp
Date: 17 Sep 2005 13:49:10 -0400
Organization: this field is intentionally left blank
References: 05-08-055 05-08-062 05-08-073 05-08-084 05-09-025 05-09-036 05-09-051
Keywords: Lisp, design
Posted-Date: 17 Sep 2005 13:49:10 EDT

On 9233 day of my life Laurence Finston wrote:
>> Do you mean Python-like behavior? Modern Lisp dialects (Common Lisp
>> and Scheme) do require variables declarations.
> I haven't programmed in Common Lisp in several years, but this
> is the behavior I was referring to:
> GCL (GNU Common Lisp) Version(2.2.1) Thu Jul 17 11:34:27 MET DST 1997

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

> >(setq a "a")
> "a"

According to ANSI Common Lisp standard (that was published in 1994),
SETQ'ing undeclared variable is undefined behavior. Some
implementations automatically declare this variable, some show an
error message. Some remove files from your home directory :)

Scheme definetely requires variable declaration.

Welcome to MzScheme version 208, Copyright (c) 2004 PLT Scheme, Inc.
> (set! a 1)
set!: cannot set undefined identifier: a

> I often write throwaway programs in Emacs-Lisp, which shows
> this behavior.

Yes, you can set undeclared variable in Elisp. But Elisp is just a
scripting language for editor, not the real thing. :)

P.S. I think it is far from topic of the list; if you wish to
continue the discussion, mail me privately or let's go to
news:comp.lang.lisp :)

Ivan Boldyrev

Post a followup to this message

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