This site is a static rendering of the Trac instance that was used by R7RS-WG1 for its work on R7RS-small (PDF), which was ratified in 2013. For more information, see Home. For a version of this page that may be more recent, see OneArmedIf in WG2's repo for R7RS-large.

One­Armed­If

cowan
2013-06-22 23:19:43
2history
source

The Scheme standards say that a one-armed if returns an unspecified value if the first argument is false. The great majority of all Schemes tested have an "unspecified value" value, which is not the same (in the sense of eq?) to any other value, and is returned as the value of (if #f #f) and in similar circumstances. The printing of this value is often suppressed by the REPL. The following are exceptions:

(if #f #f) => #f: Bigloo, JScheme, Dream, Owl Lisp

(if #f #f) => (): NexJ, TinyScheme, Elk, UMB, Llava, Dfsch, Inlab

(if #f #f) => #t: Shoe, FemtoLisp

(if #f #f) => a value which is both #f and (): XLisp, Rep

SXM returns a closure which when invoked apparently loops forever.

Note that although R6RS allows returning an unspecified number of unspecified values, including no values, no known Scheme implementation actually does so.