#493 closed defect (invalid)
set! returns its value when compiled
Reported by: | Jim Ursetto | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | 4.9.0 |
Component: | compiler | Version: | 4.6.x |
Keywords: | Cc: | ||
Estimated difficulty: |
Description
I guess this has been true for a while (it is in 4.5.5 and 4.6.4). It causes some light breakage, like if you use (display ...) on a TCP port, display will sometimes return the empty string instead of void, since there is a (set!) as the final statement in the output port lambda. So, I assume this is unintentional.
echo "(print (set! a 3))" > set.scm csc set.scm ./set 3 csi -script set.scm #<unspecified>
Change History (6)
comment:1 Changed 14 years ago by
comment:2 follow-up: 3 Changed 14 years ago by
The inconsistency. It seems the core relies on a (void) return in at least one place (tcp). Once in a while display will return the empty string instead of void. This is disconcerting, because if you are at the REPL making TCP connections, 1 out of every 10 displays might return a value, which makes the user wonder what happened. Therefore I consider this to violate the principle of least surprise. Placing a (void) at the end of the output-port writing procedure is a quick way to quiet this behavior.
comment:3 Changed 14 years ago by
Replying to zbigniew:
The inconsistency. It seems the core relies on a (void) return in at least one place (tcp). Once in a while display will return the empty string instead of void. This is disconcerting, because if you are at the REPL making TCP connections, 1 out of every 10 displays might return a value, which makes the user wonder what happened. Therefore I consider this to violate the principle of least surprise. Placing a (void) at the end of the output-port writing procedure is a quick way to quiet this behavior.
Then this is about display
, not set!
?
comment:4 Changed 14 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
Since you indicated this is not a problem with set! or display, and since I implemented a workaround in tcp6, I am closing this ticket as invalid.
Both
display
andset
have no specified return value. Are you concerned about the inconsistency?