Closed ijp closed 12 years ago
Thanks for the report. I have marked it as will-not-fix because I have not enough knowledge of the internals to change this stuff right now. In any case, R6RS does not specify a semantics for the REPL and Aziz (the original author) implemented what he thought is good for his tastes; there are a bunch of threads on the ikarus-users list[1] which, more or less, show what he wanted to allow.
R6RS does not permit redefinition of bindings imported from libraries and, as a general idea, I do not see why we should fight this behaviour; R6RS is somewhat oriented towards making compilers more efficient, so interpreters and the REPL are second class citizens.
This is the same bug as I reported at http://code.google.com/p/mosh-scheme/issues/detail?id=168 for Mosh.
What steps will reproduce the problem?
(define * (* 2 3))
*
againWhat is the expected output? What do you see instead?
The expected output for step 2 is unspecified, (in Vicare none). Instead I get
The expected output for step 3 is 6. Instead I get
The same thing happens if you try to redefine a variable imported from a library in that manner.
What version of the product are you using? On what operating system?
Ikarus Scheme version 0.0.4-rc1+ (revision 1870, build 2010-05-26) and Vicare git commit 030b0763e7e7ac5e5c6e067fc761e1bd5719767c on Fedora 13
Please provide any additional information below.
Traditionally in Scheme, a redefinition at the REPL has been equivalent to a set!. I agree that the error is appropriate behaviour for a program ran in a batch mode, however in a REPL, I'd expect to be able to rebind a variable, whether or not it would be considered immutable in batch mode, and that it would have it's previous value on it's right hand side until after the right hand side has been evaluated.
Vicare already lets me rebind variables I define myself i.e. $ vicare
It allows this behaviour if I have already redefined the previously immutable variable. $ vicare