[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
I have just scanned through the SRFI document and a fair bit of the
discussion. Just two quick thoughts.
1) (array-set! a dim0 dim1 ... dimn val) is a *really* bad specification
for this API. Yes, I know it's compatible with vector-set!, but
it's still not right. This form is deeply inefficient, requiring
list packaging of the dimensions (because of the variable length
argument list) *and* the value to be placed in the array is bundled
into the same data structure as the indicies.
either of the following is far better:
1 (array-set! a val dim0 dim1 ... dimn)
2 (array-set! a (array-index dim0 dim1 ... dimn) val)
I like 2 because of symmetry with the array-shap concept. Also it
has the nice possibility of allowing assignments to larger units of
the underlying array than just single elements.
2) The SRFI should be a completely abstract proposition. There are so
many different array implementations that might be desirable in a
given application that what I really want is an interface over
which I can parameterize other functions. then I use the builtins
for small-scale tests and move up to more efficient implementations
for production (I am specifically thinking of numerical & graph
applications here where sparse arrays/matrices can be very common).
This means that any vector/array equivalence is a *bad thing* IMO.
Christianity has not been tried and found wanting; it has been found
difficult and not tried.
-- G.K. Chesterton