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

length



Is (LENGTH '(3 . 3)) an error?

Lucid Common returns 1.
Symbolics Common returns error.

The bible states:

p248:  length takes a sequence
p245:  sequences are lists and arrays
p27:   often the term list refers either to true lists or to dotted lists.
       When the distinction is important, the term "true list" will be
       used to refer to a list terminated by nil. Most functions
       advertised to operate on lists expect to be given true lists.
       Throughout this manual, unless otherwise specified, it is an
       error to pass a dotted list to a function that is specified
       to require a list as an argument.
p27:   implementors are encouraged to use the equivalent of the predicate
       ENDP whenever it is necessary to test for the end of a list.
       Whenever feasible, this test should explicitly signal an error
       if a list is found to be terminated by a non-nil atom. However,
       such an explicit error is not required ....

It seems that one should 'signal an error' and that it 'is an error'
but, well, maybe not.

comments? Has this been resolved before?

tim
DALY@IBM.COM
IBM T.J. Watson Research Center
Yorktown Heights, N.Y.