Open knorth55 opened 6 years ago
clisp also returns error:
> (reverse (cons 1 2))
*** - REVERSE: A proper list must not end with 2
We can check common lisp standard at http://www.lispworks.com/documentation/HyperSpec/Front/
'reverse' is described at http://www.lispworks.com/documentation/HyperSpec/Body/f_revers.htm type-error if sequence is not a proper sequence.
So, SBCL and clisp keep common-lisp standard, but euslisp doesn't.
so you mean we need to set our standard?
We have to be careful for changing behavior of existing software. Even if it seems right and easy to fix it. We have to evaluate profit and bad effect from fixing it.
In this case, I think we can fix it. some existing programs may change behavior, but not so many.
euslisp manual P.35 reverse sequence / reverse the order of sequence and returns a new sequence of the same type as sequence. ( Not described about improper sequence )
EDIT Sorry, was completely unrelated. Posted on #258.
I think we have two options.
(reverse (cons 1 2)) => (cons 2 1)
can be useful.
Actually, I expected to get the value as above.
SBCL returns type error for argument.