Subject: Re: matrix implementation considerations
From: rpw3@rpw3.org (Rob Warnock)
Date: Sat, 30 Jul 2005 22:55:26 -0500
Newsgroups: comp.lang.lisp
Message-ID: <Eu6dnZRJ_qkz1nHfRVn-pQ@speakeasy.net>
Michiel Borkent <michielborkent@gmail.com> wrote:
+---------------
| For some reason I have implemented the matrix as a list of arrays.
+---------------

Is there some particular reason you didn't use Common Lisp's native
multi-dimensional arrays?  E.g.:

    > (let ((demo-data (loop for i below 3 collect
			 (loop for j below 4 collect (+ (* i 10) j)))))
        (make-array '(3 4) :initial-contents demo-data))

    #2A((0 1 2 3) (10 11 12 13) (20 21 22 23))
    > (describe *)

    #2A((0 1 2 3) (10 11 12 13) (20 21 22 23)) is an array of rank 2.
    Its dimensions are (3 4).
    > 


-Rob

-----
Rob Warnock			<rpw3@rpw3.org>
627 26th Avenue			<URL:http://rpw3.org/>
San Mateo, CA 94403		(650)572-2607