mit-scheme-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MIT-Scheme-users] The behavior of set!


From: Alexey Radul
Subject: Re: [MIT-Scheme-users] The behavior of set!
Date: Wed, 20 Jan 2010 13:21:04 -0500

If I recall correctly, the Scheme standard leaves the return value of
set! unspecified.  In MIT Scheme, the return value is still officially
unspecified, but the actual implementation of set! returns the old
value that was replaced.

~Alexey

On Tue, Jan 19, 2010 at 10:42 PM, Peng Yu <address@hidden> wrote:
> According to the following webpage,
>
> http://www.shido.info/lisp/scheme_asg_e.html
>
> (define var 1)
> (set! var (* var 10))
> var => 10
>
> However, I get the following output from mit-scheme, when I try the
> code. Would you please let me know what ';Value: 1' means? Is '1' the
> old value of 'var'?
>
> 1 ]=> (define var 1)
> ;Value: var
>
> 1 ]=> (set! var (* var 10))
> ;Value: 1
>
> 1 ]=> (+ var 1)
> ;Value: 11
>
>
> _______________________________________________
> MIT-Scheme-users mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/mit-scheme-users
>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]