From: Timothy H. <tim...@ma...> - 2003-03-07 17:19:51
|
On Friday, March 7, 2003, at 11:20 AM, Robert J. Bobrow wrote: > Folks, > I would expect that (cadr x) and (car (cdr x)) would behave > identically in all circumstances. Yet I find that car and cdr behave > like Common Lisp and return '() when given '() as an argument (I like > this, personnaly) and cadr throws an exception when handed '(); > > I think the inconsistency is annoying -- I really prefer not to have > (car (cdr x)) in my code. I've fixed that inconsistency, cadr and caddr were treated differently from all other cadadars I have however kept that behavior for second and third. So (second '(a)) --> error (cadr '(a)) --> () Perhaps it would be better to have second and third adhere to the same semantics of cadr and caddr, but in a way it makes sense for second/third to give errors if the lists are too short.... I'd also like to add third, fourth, fifth, .... up to tenth or so.... What do you think? ---Tim--- |