Matrix transposition: Difference between revisions

Line 1:
{{task|Matrices}}[[wp:Transpose|Transpose]] an arbitrarily sized rectangular [[wp:Matrix (mathematics)|Matrix]].
 
=={{header|ACL2}}==
<lang Lisp>(defun cons-each (xs xss)
(if (or (endp xs) (endp xss))
nil
(cons (cons (first xs) (first xss))
(cons-each (rest xs) (rest xss)))))
 
(defun list-each (xs)
(if (endp xs)
nil
(cons (list (first xs))
(list-each (rest xs)))))
 
(defun transpose-list (xss)
(if (endp (rest xss))
(list-each (first xss))
(cons-each (first xss)
(transpose-list (rest xss)))))</lang>
 
=={{header|ActionScript}}==
Anonymous user