On Fri, Nov 16, 2012 at 9:12 AM, Mirko Vukovic <mirko.vukovic@gmail.com> wrote:
Liam,

I looked at the code.  I'll take your email as an offer to guide.  And
you can take this email as an offer to hack.

A few questions:

What type should a vector of vectors be?  Currently, you are
specializing on lists and arrays.  Should I define a new type, or
should it be of array type where specify vector of vectors in
`rest-spec' of make-grid-data?

I don't know what you mean.  Types and classes are different things, and specialization takes place on classes.

My idea is that the specification of a vector of vectors of double-floats is e.g.
((array 3) (array 4) double-float)
so this would look to CL like something of type array or vector.  There isn't a need to define a new type, but I suppose you could make one up.  I'm not sure what purpose it would serve.

 

In the former case, we will have a proliferation of new data structures.

In the latter case, the methods that specialize on array (make-array,
grid-ref) would have to do some internal testing and then branching
off.

cl:make-array is not anything we can do anything about, it is not a generic function.
make-grid would need to be generalized to make a multiarray, yes.  There is work there to be done.  grid-ref is obsolete; you would need to modify grid:aref, grid:aref*, (setf grid:aref), (setf grid:aref*).  (The file multiarray.lisp is old and has not been touched in over a year, it was just a collection point for the temporarily abandoned multiarray code and grid changes took place without it being modified after that.)


Are grids meant to be extendable (like vector-push-extend)?  I would
argue for that capability.

That would be nice, but I haven't thought about how to do it.  Also nice would be to handle displaced arrays and views (subarrays that aren't actually copied out of the original array).  I think Tamas has done some work on displaced arrays.

Mirko