[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Update, near finalization

David Van Horn wrote:
The draft of SRFI 63 Homogeneous and Heterogeneous Arrays has been updated to resolve the Issues section (cf previous drafts). This draft will be finalized if there are no concerns raised in the next couple of days.


I strongly object.  array-set! is inconsistent with srfi-25, and you
cannot distinguish between the variants by their arguments types.
This is a recipe for disaster.

(array-set! array k ... obj)
(array-set! array index obj)
(array-set! array obj k1 ...)

It is claimed that "Type dispatch on the first argument to array-set! could support both SRFIs simultaneously." I don't believe that.
How would you handle:
(define array (vector 'a 'b))
(set! array 1 0)
Is the result #(a 0) or #(1 b)?

make-array is also inconsistent:
(make-array shape)
(make-array shape obj)
(make-array prototype k1 ...)
It is claimed that: "Type dispatch on the first argument to make-array
could support both SRFIs simultaneously."  I don't believe that is
correct, as written, since a SRFI-25 shape is a d*2 array, and a SRFI-67
prototype can also be an array.  Thus they can conflict.  Consider:
(define v (shape 0 1))
(make-array v 10)

The conflict can be avoided by requiring that prototypes have rank 0
or 1, which seems a reasonable restriction.

Much cleaner would be to choose a different name.
	--Per Bothner
per@xxxxxxxxxxx   http://per.bothner.com/