set! problem
Robert D. Skeels
athene@earthlink.net
Sun Jul 2 11:14:00 GMT 2000
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 ")
More information about the Kawa
mailing list