[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Scheme-reports] r7rs-draft-6: examples for when and unless



The examples of when and unless do not provide the "and prints ..." 
block that normally accompanies examples that invoke write/display.  
Having two expressions in the scope of when/unless and not showing any 
output does not expose the implicit begin that comes with these 
"one-sided if" syntaxes.  Also, there is a missing closing bracket after 
(display "2") in both current examples.

What about a joined example for both when and unless, such as:

(begin
   (when (= 1 1.0)
     (display "1 and 1.0 are considered equal")
     (newline))
(unless (= 1 1.0)
     (display "1 and 1.0 are not considered equal")
     (newline)))

prints exactly one of
   1 and 1.0 are considered equal \emph{newline}
or
   1 and 1.0 are not considered equal\emph{newline}
depending on the details of the implementation.

Of course, that's an artificial example, but it confirms the existence 
of the implicit begin to the reader.
--
Daniel Villeneuve
AD OPT, a Kronos Division





_______________________________________________
Scheme-reports mailing list
Scheme-reports@x
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports