[plt-scheme] If expressions in Embedded PLT Scheme

From: Henk Boom (lunarc.lists at gmail.com)
Date: Wed Oct 8 13:16:20 EDT 2008

2008/10/8 Samuel Rebelsky <rebelsky at grinnell.edu>
>
> I am embedding MzScheme/PLT Scheme in a program.
>
> In MzScheme (v372 is the one I had been using), it was permissible to write if expressions without an alternate, as in
>
>  (if (> x 1) (display x))
>
> When I embed the new PLT Scheme (v401, I think), for the same expression, I get an error message that it 'must have an "else" expression'.
>
> R6RS seems to suggest that the no-alternate form is still valid
>
>  http://www.r6rs.org/final/html/r6rs/r6rs-Z-H-14.html#node_sec_11.4.3
>
> Is there a way to turn off the "require alternate" behavior in embedded PLT Scheme?

It's generally recommended to use 'when' instead in this case.

    Henk


Posted on the users mailing list.