[racket-dev] repl, void, multiple values.

From: Pierpaolo Bernardi (olopierpa at gmail.com)
Date: Fri Apr 6 04:19:25 EDT 2012


not an important point, just a simple observation that I don't
remember having ever seen raised:
the repl not printing the void object, sometimes creates ambiguities.

Example, given:

(define (ok)

(define (not-ok)
  (let ((answer 40))
    (set! answer (+ answer 2))))

and at the repl:

> (values (ok)
> (values (not-ok)

omitting void loses information about which value is which.


I made a mistake similar to the not-ok function in real code,
and the ensuing interaction at the repl confused me for a minute or two.
Had I seen
I would have seen immediately my mistake.

Would be sensible to print all the values, even the void value, when
there's more than one value to print?


Posted on the dev mailing list.