Matrix transposition: Difference between revisions

Added LFE implementation
(Added LFE implementation)
Line 1,465:
[ 4 8 12 ]
]</pre>
 
=={{header|LFE}}==
 
<lang lisp>
(defun transpose (matrix)
(zip matrix '()))
 
(defun transpose (matrix acc)
(cond
((lists:any
(lambda (x) (== x '()))
matrix)
acc)
('true
(let ((heads (lists:map #'car/1 matrix))
(tails (lists:map #'cdr/1 matrix)))
(transpose tails (++ acc `(,heads)))))))
</lang>
 
=={{header|Liberty BASIC}}==
Anonymous user