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

Re: [Scheme-reports] **-copy! doesn't specify when start and end is omitted



On Mon, Nov 12, 2012 at 3:37 PM, Per Bothner <per@x> wrote:
On 11/11/2012 09:54 AM, Takashi Kato wrote:
> On 11/11/2012 18:24, Arthur A. Gleckler wrote:
>> On Sun, Nov 11, 2012 at 9:06 AM, Takashi Kato <ktakashi@x
>> <mailto:ktakashi@x>> wrote:
>>
>>      string/vector/bytevector-copy! procedures don't specify when start and
>>      end parameters are omitted. I think it is better to mention either it
>>      must copy somehow properly or signals an error.
>>
>>
>> Please see the notes under the table on page 7 (section 1.3.3).
> Well, still it doesn't specify which bytevector/string/vector's start
> and end. I couldn't read whether or not this is legal.
>
> (let ((bv (bytevector 1 2 3 4 5)))
>     (bytevector-copy! bv 2 #u8(6 7 8 9 10))
>     bv))

It sort-of does, in a rather terse way:

   "Copies the elements of vector from between start and end
   to vector to, starting at at."

So start and end identifiers the elements of from, and at
identifies the index in to where they get copied to.

Perhaps a re-phrasing might help:

   The elements of vector 'from' between 'start' and 'end'
   (as defined in section 1.3.3) are copied into vector 'to',
   starting at index 'at' (replacing elements from 'at'
   through 'at+(end-start)').

This is the only reasonable interpretation, but I agree
that for these three cases where there are multiple
sequence types it would be better to be explicit.  We'll
rephrase this.

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