Re: SRFI 231 - Easy conversion for common array formats
Bradley Lucier 20 Jan 2022 17:57 UTC
On 1/20/22 11:19 AM, Jens Axel Søgaard wrote:
> FWIW list*->array and vector*->array are defined here:
>
> https://github.com/racket/math/blob/master/math-lib/math/private/array/untyped-array-convert.rkt
> <https://github.com/racket/math/blob/master/math-lib/math/private/array/untyped-array-convert.rkt>
I need advice before proceeding further.
I defined
(array nested-list-or-vector dimension [storage-class [mutable? [safe?]]]
to have something that at least looked like the (array ...) syntax in
Racket's math/array. This was the main motivation, to have something
that looks like Racket's (array ...) form, so this SRFI looks familiar
to existing Racket users.
This routine, of course, had a lot of similar code for the list and
vector cases.
Following this email from Jens, I defined separate list*->array and
vector*->array routines.
Now, all (array ...) does is some error checking then call the "unsafe"
versions of list*->array or vector*->array as appropriate.
I'm not going to make (array ...) a macro because, frankly, I don't know
how to do it in a way that makes sense.
MY QUESTION:
Is (array ...) even necessary? Or can people just use
(vector*->array nested-vector dimension)
in place of
(array nested-vector dimension)
I'm voting to remove (array ...).
Brad