Re: [Scheme-reports] vector-insert John Cowan (19 Aug 2014 17:26 UTC)
Re: [Scheme-reports] vector-insert Pierpaolo Bernardi (19 Aug 2014 18:30 UTC)
Re: [Scheme-reports] vector-insert John Cowan (19 Aug 2014 19:01 UTC)
Re: [Scheme-reports] vector-insert Pierpaolo Bernardi (20 Aug 2014 00:38 UTC)

Re: [Scheme-reports] vector-insert John Cowan 19 Aug 2014 18:56 UTC

Pierpaolo Bernardi scripsit:

> (make-vector-from-pieces dim default init...)
>
> where each of the inits specifies a range to be filled in the new
> vector, and an existing vector with a starting point, to be copied in
> that range.  Ranges not included in any /init/ will be initialized
> with /default/, as in make-vector.

That's an interesting variant of vector-append.  I've added it to
VectorsCowan, my proposed vector library (a superset of SRFI 43).

> This function can be implemented trivially in any Scheme, and an
> implementor can supply a version for his implementation which avoids
> double assignments in the newly  created vector, and is also safe.

Indeed.

--
John Cowan          http://www.ccil.org/~cowan        cowan@ccil.org
Arise, you prisoners of Windows / Arise, you slaves of Redmond, Wash,
The day and hour soon are coming / When all the IT folks say "Gosh!"
It isn't from a clever lawsuit / That Windowsland will finally fall,
But thousands writing open source code / Like mice who nibble through a wall.
        --The Linux-nationale by Greg Baker

_______________________________________________
Scheme-reports mailing list
Scheme-reports@scheme-reports.org
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports