filling and assigning Alex Shinn (06 May 2021 14:32 UTC)
Re: filling and assigning Bradley Lucier (06 May 2021 16:35 UTC)
Re: filling and assigning Alex Shinn (07 May 2021 02:29 UTC)
Re: filling and assigning Bradley Lucier (07 May 2021 11:18 UTC)
Re: filling and assigning Marc Nieper-Wi├čkirchen (07 May 2021 11:53 UTC)
Re: filling and assigning Alex Shinn (07 May 2021 13:38 UTC)

filling and assigning Alex Shinn 06 May 2021 14:32 UTC

Storage classes require a constructor which can take any
initial value, but there is no way to override the default from
the storage class.  It would be nice to have a way to do this.
Otherwise an array-fill! would help, though be less efficient.

What is the rationale for having array-assign! require the
destination elements to be stored adjacently in order?  This
case is easier to optimize for, but it can be useful to assign
in non-adjacent cases.  In fact, it can be unpredictable when,
through some series of transformations, an array which use
to be adjacent no longer is, breaking the assignment.

I was caught by this implementing a new utility,
array-concatenate.  Trying to rely on high-level operations,
a clean way to implement this is to construct the destination
which is the sum of the two input domains along a dimension,
then array-assign! each input to its array-extracted offset
within the destination.  But these elements will not be
adjacent.

Without being able to use array-assign! and without interval
cursors, the implementation of concatenate is quite difficult.

--
Alex