David Rush <kumo@bellsouth.net> wrote:
+---------------
| Or perhaps more to the point in c.l.s, What can you say about
| the return value of
| (define (void) (if #f #f))
| Mostly, I'm curious about how the various implementations handle this
| value. So far I've looked at Scheme48, Bigloo, and Guile, and they all
| return a singleton value which is EQ? to itself.
+---------------
Add MzScheme to that list. It defines "void" as a primitive procedure,
gives most R5RS "unspecified" values -- such as (if #f #f) -- the
value "#<void>", and the top-level REPL suppresses printing the
result of an expression evaluation if the value is "#<void>" (hence
the need below for using "display" to print it):
> void
#<primitive:void>
> (void)
> (begin (display (void)) (newline))
#<void>
> (if #f #f)
> (eq? (void) (if #f #f))
#t
> (define foo 123)
> (set! foo 456)
> (eq? (void) (set! foo 789))
#t
> foo
789
>
-Rob
-----
Rob Warnock, 41L-955 rpw3@sgi.com
Applied Networking http://reality.sgi.com/rpw3/
Silicon Graphics, Inc. Phone: 650-933-1673
1600 Amphitheatre Pkwy. PP-ASEL-IA
Mountain View, CA 94043