On Oct 12, 1:33 am, "Mark H." <[EMAIL PROTECTED]> wrote:
> On Oct 11, 10:23 pm, "Mark H." <[EMAIL PROTECTED]> wrote:
>
> > Some people might want to take slices of matrices -- e.g., the following
> > (in Matlab notation):
>
> > A( 1:2:end, 1:3:end )
>
> > which is a matrix containing every second row and every third column
> > of A.
>
> Speaking of which, what's the right idiom to take a 2-D slice of a 2-D
> array in Clojure? It's not really a seq because the slice implements
> the same interface as an array (with random access to elements).
> Also, a seq of seqs would constrain iteration either to a rowwise or
> columnwise direction, whereas the user might want to iterate both ways
> over the same slice (e.g., for the matrix-matrix multiplication C <- A
> * A, one might iterate rowwise over the left A and columnwise over the
> right A).
>
As this discussion highlights, Clojure doesn't have a proper notion of
multidimensional arrays or vectors. I saw a presentation on IBM's X10
[1] and was impressed by their point-indexed arrays. I think there are
some good ideas in there that might inspire a nice contribution to
Clojure.
Rich
[1] http://x10-lang.org/
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---