This is the mail archive of the
kawa@sourceware.cygnus.com
mailing list for the Kawa project.
Re: set! problem
- To: Kawa Mailing List <kawa at sourceware dot cygnus dot com>
- Subject: Re: set! problem
- From: "Robert D. Skeels" <athene at earthlink dot net>
- Date: Sun, 02 Jul 2000 11:14:01 -0700
06/30/2000 07:37, Daniele Maraschi maraschi@lirmm.fr:
> I found something not very conformed to Standard Scheme:
>
> [daniele@einstein kawa]$ java kawa.repl
> #|kawa:1|# (set! a 5)
> #|kawa:2|# a
> 5
> #|kawa:3|#
>
> I think probably I should get an error if I modified a variable
> that I haven't define before!!
> What do you think ?
Not being an expert, I can't say my response is qualified. However, after
reviewing sections 4.1.6 and 5.2.1 of the R5RS I find that you're correct.
From 5.2.1:
> ... whereas it would be an error to perform a `set!' on an unbound
> variable.
That being said, I find in practice it is implementation dependent on how
set! deals with unbound values. Some seem to treat set! in the same way as
define when a variable is unbound (see 5.2.1). GambitC treats set! on
unbound variables like Kawa does. SCM does not, and I haven't had time to
check any others.
((lambda (args) (display args)) "
Robert D. Skeels | Los Angeles illustrator, designer
athene@earthlink.net | http://home.earthlink.net/~athene
webmaster@synchrotech.com | http://www.synchrotech.com")