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 <[email protected]> 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 > [email protected] > http://lists.gnu.org/mailman/listinfo/mit-scheme-users > _______________________________________________ MIT-Scheme-users mailing list [email protected] http://lists.gnu.org/mailman/listinfo/mit-scheme-users
