Re: Common Lisp `row-major-aref`
Per Bothner 11 Sep 2023 00:41 UTC
On 9/9/23 16:33, Bradley Lucier wrote:
> I think, e.g., Gambit would need to redefine vector-ref and vector-set! to be more like Kawa's vector-ref and vector-set! for array->vector to be allowed to return a view instead of a newly allocated vector.
If it would help SRFI-164's acceptance, I wouldn't be opposed to renaming a few functions,
such as array->vector to something else, such as array->vector-view.
That would presumably require a new SRFI. The specification for array->vector-view
should probably be modified so it returns a rank-1 0-based array or a gvector:
A library-based implementation probably would not be able to return a native
vector as a view of an array - except when the array is "simple".
(Perhaps we should have swapped the names array-flatten and array->vector,
though of course that is harder to do.)
--
--Per Bothner
xxxxxx@bothner.com http://per.bothner.com/