SRFI 231 - Easy conversion for common array formats Jens Axel Søgaard (13 Jan 2022 15:53 UTC)
Re: SRFI 231 - Easy conversion for common array formats Bradley Lucier (13 Jan 2022 19:30 UTC)
Re: SRFI 231 - Easy conversion for common array formats Jens Axel Søgaard (13 Jan 2022 21:46 UTC)
Re: SRFI 231 - Easy conversion for common array formats Bradley Lucier (16 Jan 2022 22:11 UTC)
Re: SRFI 231 - Easy conversion for common array formats John Cowan (17 Jan 2022 18:50 UTC)
Re: SRFI 231 - Easy conversion for common array formats Bradley Lucier (18 Jan 2022 16:52 UTC)
Re: SRFI 231 - Easy conversion for common array formats John Cowan (19 Jan 2022 23:25 UTC)
Re: SRFI 231 - Easy conversion for common array formats Lucier, Bradley J (19 Jan 2022 23:45 UTC)
Re: SRFI 231 - Easy conversion for common array formats Bradley Lucier (20 Jan 2022 15:54 UTC)
Re: SRFI 231 - Easy conversion for common array formats Jens Axel Søgaard (20 Jan 2022 16:19 UTC)
Re: SRFI 231 - Easy conversion for common array formats Bradley Lucier (20 Jan 2022 17:57 UTC)
Re: SRFI 231 - Easy conversion for common array formats Jens Axel Søgaard (20 Jan 2022 19:08 UTC)

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