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

Re: Update, near finalization

This page is part of the web mail archives of SRFI 63 from before July 7th, 2015. The new archives for SRFI 63 contain all messages, not just those from before July 7th, 2015.



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.

   http://srfi.schemers.org/srfi-63/srfi-63.html

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.

STFI-25:
(array-set! array k ... obj)
(array-set! array index obj)
SRFI-63:
(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:
SRFI-25:
(make-array shape)
(make-array shape obj)
SRFI-63:
(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/