I have created a function that takes an arbitrarily long list of numbers as an argument. From this list, I wish to create matrices locally using let
. The matrices will have rows and columns based on the number sequence inside the list. For example,
>(foo '(2 2 3) arg2 ... argn)
should locally create
M1: #2a((0 0)(0 0)) M2: #2a((0 0 0)
(0 0 0))
that is, the first matrix takes its dimensions from the first two elements adjacent elements in the list, etc.
My question is: Is there a way to iteratively create the arbitrarily long set of local variables Mn
in a let
expression? Or is this a case where I should use a macro?