On 21 Nov 2016, at 15:01, Panicz Maciej Godek <godek.mac...@gmail.com> wrote:

> As far as accessors are concerned, I'm not sure whether they actaully need 
> names. Maybe it would be better to make them applicable, and produce 
> "procedures with setters"?

I'd absolutely prefer (A i j) to (array-whatever A i j). Arrays *are* functions 
of indices.

But the mechanism for applicable objects isn't being used right now for any of 
the data structures with accessors. It isn't documented in the manual, either. 
I don't know how it works. Some patches are needed there, examples. Moreover if 
the type of arrays is changed (which I believe is needed to make arrays an 
applicable object), then we must retain compatibility with all the existing 
array procedures. I like the idea, but I don't think it's going to happen for 
2.2.

Procedures with setters would remove the need for the modifying function 
(array-slice-copy! or whatever it ends up being called), but this isn't done 
now even for the pair array-ref / array-set!. However it is easier to implement.

My idea has always been to move the array descriptor (storage pointer, strides, 
etc), which is now an opaque C object, to Scheme. Then we could do lots of 
stuff without having to rebuild Guile, take advantage of compiler 
optimizations, etc. But even that isn't in the cards for 2.2. At least I don't 
think anyone is working on it.


Reply via email to