Hi,

Albert Krewinkel wrote:
>I'm doing some matrix operations and would like to use iterate for
>going through my matrices element wise.  Writing an driver to do this
>was pretty easy (great tools and manual!), but it doesn't allow me to
>alter entries in my matrix.

>(symbol-macrolet ((el (aref vec row-index col-index)))
>   (... body...))
Macrolet is a possibility, but what about writing a driver that provides
access to the 2 index variables, modeled after in-vector?
(for x in-vector foo with-index i)
(for e in-matrix foo with-indices (i j))
  (setf (aref foo i j) bar)

BTW, how do you use Iterate to walk across a 2-dimensional thing like a
matrix? This would likely involve 2 nested iterations, so any single
clause does not provide a complete solution?!?

Regards,
        Jorg Hohle
_______________________________________________
iterate-devel site list
iterate-devel@common-lisp.net
http://common-lisp.net/mailman/listinfo/iterate-devel

Reply via email to