|
SRFI 231 and empty arrays Bradley J Lucier (31 Mar 2026 16:08 UTC)
|
|
Re: SRFI 231 and empty arrays
Bradley J Lucier
(01 Apr 2026 17:50 UTC)
|
|
Re: SRFI 231 and empty arrays
John Cowan
(01 Apr 2026 21:30 UTC)
|
|
Re: SRFI 231 and empty arrays
John Cowan
(01 Apr 2026 21:47 UTC)
|
|
Re: SRFI 231 and empty arrays
Bradley J Lucier
(01 Apr 2026 22:21 UTC)
|
|
Re: SRFI 231 and empty arrays
Per Bothner
(01 Apr 2026 22:44 UTC)
|
|
Re: SRFI 231 and empty arrays
John Cowan
(01 Apr 2026 23:30 UTC)
|
|
Re: SRFI 231 and empty arrays
Bradley Lucier
(01 Apr 2026 23:43 UTC)
|
|
Re: SRFI 231 and empty arrays
John Cowan
(02 Apr 2026 00:36 UTC)
|
|
Re: SRFI 231 and empty arrays
John Cowan
(01 Apr 2026 23:04 UTC)
|
|
Re: SRFI 231 and empty arrays
Arthur A. Gleckler
(01 Apr 2026 17:57 UTC)
|
The reference to SRFI 213 should be to SRFI 231. The specification might be ambiguous for empty arrays. These examples for array->list* are from SRFI 231: ========================= If array is zero dimensional, then array->list* returns ((array-getter array)). If the argument is an empty array, then the nested lists of the result match the first nonzero dimensions (if any). For example: (array->list* (make-array (make-interval '#()) (lambda () 2))) => 2 ;; no list (array->list* (make-array (make-interval '#(0)) error)) => '() (array->list* (make-array (make-interval '#(0 0)) error)) => '() (array->list* (make-array (make-interval '#(2 0)) error)) => '(() ()) (array->list* (make-array (make-interval '#(0 2)) error)) => ‘() ========================= The examples for list*->array are ========================= Empty and zero-dimensional lists are treated differently; see the discussion for array->list*. For example (list*->array 0 '()) => An array for which ((array-getter (list*->array 0 '()))) => '() (list*->array 1 '()) => An empty array with domain (make-interval '#(0)) (list*->array 2 '()) => An empty array with domain (make-interval '#(0 0)) (list*->array 2 '(() ())) => An empty array with domain (make-interval '#(2 0)) ========================= list*->array has no way to create an array with lower bounds ‘#(0 0) and upper bounds ‘#(0 2). (You can do that with list->array, which specifies the interval, not just the dimension.) In your notation, how would you specify an empty array literal with lower bounds ‘#(0 0) and upper bounds ‘#(0 2)? I agree with Per Bothner that a formal grammar would be helpful. Brad