I recently discovered that all of my implementations of Scheme throw an error when I try to use (cadaddr (list 1 3 (list 5 7) 9))
. Apparently, by default Scheme does not allow any car
and cdr
combinations in the single-function form that use more than four abbreviated car
and cdr
calls. I originally blamed this on Scheme's minimalism, but then I discovered that Common Lisp also shares this defect.
Can this be solved with a macro? Can we write a macro that allows an arbitrary amount of a
and d
in its c[...]r
calls and returns the expected result, while also having the Common Lisp-like compatibility with macros like setf
? If not, why not? And if so, has a reason ever been given for this is not a default feature in any lisp that I've seen?