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