[slime-devel] transpose-lists

Edi Weitz edi at agharta.de
Tue Aug 9 16:05:51 UTC 2005


[Look at what Gnus made out of your email address.  Strange...]

On Tue, 09 Aug 2005 17:18:52 +0200, Helmut at agharta.de, Eller at agharta.de, <heller at common-lisp.net> wrote:

> Uugh, how ugly :-)
>
> How about?
>
> (defun transpose-lists (lists)
>   (cond ((some #'null lists) '())
>         (t (cons (mapcar #'car lists)
>                  (transpose-lists (mapcar #'cdr lists))))))

Ugh, how nice... :)

Damn, I knew there was a recursive solution lurking in there.

My only excuse is that my version seems to be about twice as fast on
CMUCL and LispWorks.  Call it premature optimization... :)

Cheers,
Edi.



More information about the slime-devel mailing list