I wrote this macro for explaining 'MAPCAR in terms of 'LOOP to
pizzapal deep within one of James' mastodon threads.
|#
(defmacro loopcar (fun &rest lists
&aux (syms (loop for x in lists
collect (gensym))))
`(loop ,@(loop for list in lists
for sym in syms
nconcing (list :for syn :in list))
collecting (funcall ,fun ,@syms)))
#|
We were also talking about how big the common lisp standard is: But
there's so much useful stuff in there (that went into my explanation
of 'MAPCAR). I had actually been hoping to find a simple definition of
mapcar's behaviour analogous to this definitionally correct
description of mapcon in terms of maplist:
(mapcon f x1 ... xn)
:= (apply #'nconc (maplist f x1 ... xn))
but mapcar and maplist get prose definitions. Maybe