From: Robert J. B. <ru...@bb...> - 2003-03-07 19:16:34
|
Tim, I am comfortable with second and third showing an error -- their intended semantics is to treat the sequence of linked pairs as a linear structure and get the numbered element. It is an "implementation detail" that second is the same as cadr. I also support having symbolic methods fourth, ... tenth -- I keep getting burned by their absense. Thanks, Rusty Timothy Hickey wrote: > > 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--- > > |