On Tue, Dec 6, 2011 at 4:48 PM, Marijn <hk...@gentoo.org> wrote: > > Couldn't help but wonder why they don't return the value of the last > body form, so I looked around a bit and both CLHS[1] and my racket > REPL seem to agree that they should: > > $ racket > Welcome to Racket v5.2.0.4. >> (when #t 'hello) > 'hello >> (unless #f 'hi) > 'hi > > Is there some other source that suggests that the return value should > be unspecified?
Because the result is meaningless when the condition is false. CLHS returns nil in this case, but that fits with CL idioms and not Scheme idioms. when and unless are for side-effects - it's better to write (and #t 'hello) if you want the result. R7RS also leaves it unspecified. -- Alex