[plt-scheme] Why does (begin ((lambda () (values))) (display "k")) fail?

From: Doug Orleans (dougo at place.org)
Date: Wed May 19 13:29:44 EDT 2004

Noel Welsh writes:
 > I can't explain it, but it only seems to occur when
 > the value of (values) is used in another expression.

Check the MzScheme manual:

  Multiple return values are legal in MzScheme whenever the return
  value of an expression is ignored. For example, all but the last
  expression in a `begin' form can legally return multiple values in
  any context.

Of course "multiple return values" really means "any number of return
values", i.e. including zero.

--dougo at place.org

Posted on the users mailing list.