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 16 Jan 2022 22:11 UTC

On 1/13/22 4:46 PM, Jens Axel Søgaard wrote:
>     3.  An array with a generic storage class can store lists or vectors or
>     other arrays as its entries, so without specifying a domain
>     interval, or
>     at the very least a domain dimension, the examples you give are
>     ambiguous.  I suppose if arrays hold only numbers, then it is
>     unambiguous.
>
>
> I must admit I didn't think of that.

I made some changes to

https://github.com/gambiteer/srfi-231/tree/specialized-from-data

that did not include code to implement this suggestion.

I suppose one could do something like

(define (fast-array nested-list interval)
   (list->array (flatten nested-list) interval))

but I don't see how to get around specifying the domain interval.

Or perhaps

(define (nested-list-of-numbers->array nested-list)
   (if (right-shape nested-list)
     (list->array (flatten nested-list) (nested-list->interval
nested-list))))

where nested-list->interval does the obvious thing, but I'm not sure
that this should be in the library.

Brad