bug-guile
[Top][All Lists]
Advanced

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

Re: (< complex) and friends


From: Jon Wilson
Subject: Re: (< complex) and friends
Date: Fri, 19 Sep 2008 19:59:02 -0400
User-agent: Thunderbird 2.0.0.16 (X11/20080724)

Bill Schottstaedt wrote:
map does not accept no list:
But it does accept the empty list, which is what I intended to say, but didn't make clear.


guile> (map (lambda (a) a))

Backtrace:
In standard input:
   1: 0* [map #<procedure #f (a)>]

standard input:1:1: In procedure map in expression (map (lambda # a)):
standard input:1:1: Wrong number of arguments to #<primitive-generic map>
ABORT: (wrong-number-of-args)


+ and * have a "natural" identity (0 and 1), so it is not silly that (+ a) is
(+ a 0) and (+) is (+ 0 0), but #t does not strike me as a natural identity
for < -- (< 1 1) is #f.   But I hate these kinds of discussions, so I defer...

A natural identity for a predicate like this is either #t or #f. The choice is really left up to the implementor, but should probably match other implementations (at least those that have some sort of identity) for the sake of consistency, and should most especially match the language in the specification or the manual (which should match each other where they overlap, of course!). I'm not too concerned with which way the degenerate case goes (except in that it matches language and convention), but I do feel that the degenerate case should not be an error.
Regards,
Jon




reply via email to

[Prev in Thread] Current Thread [Next in Thread]