[r6rs-discuss] Comparison procedures' number of arguments
Ken Dickey
Ken.Dickey at whidbey.com
Sat Oct 18 22:43:12 EDT 2008
On Saturday 18 October 2008 18:56:01 John Cowan wrote:
> Derick Eddington scripsit:
> > Why does R6RS specify that predicates like =, <, >=, char<?, fx>=?, etc.
> > accept a minimum of two arguments instead of accepting zero or more?
>
> What would be the "obvious" value of (< 2) or (=)? I have no idea whether
> #t or #f would win here.
#!NaB [Not a Boolean]. 8^)
But this would seriously torque compiler logic requiring booleans. [NaN is
only seen as a win because failure checking can be delayed and save some
computational time. Personally I prefer exceptions].
#f is the obvious base case as comparisons with nothing can't be true and in
Scheme anything not #f is true (even #!Nan).
> (if +nan.0 1 2)
1
> (< +nan.0 1)
#f
> (< 1 +nan.0)
#f
So #f is the obvious, consistent base case.
$0.02,
-KenD
"Do you walk to school or take a lunch?" ;^)
More information about the r6rs-discuss
mailing list