Well, i've been told to make a Matrix Transpose function in common lisp. I'm a beginner, so i don't know so much of it.
My Matrix is a list of lists, and i can't use apply, mapcar or similar to solve it, just CONS, CAR and CDR. If not, my solution would be this (I put this solution so someone can use it):
(DEFUN transpose (List)
(apply #'mapcar #'list List)
)
But I can't use anything of the above.
The function has to be recursive, no loops or similar.
So, the question is, how could this be done?
This is how far i've gone, but it gets me an overflow error. I don't really know how to do it (i could have done it in C++ or Java, but i'm asked to do it in Lisp...)
(DEFUN transpose (Matrix)
(COND ((NULL Matrix) NIL
)
(T (CONS (CAR(CAR Matrix))(transpose (CONS (CAR(CDR Matrix)) (CDR Matrix))))
)
)
)
Any help would be thanked!