[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 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)').
-- 
	--Per Bothner
per@x   http://per.bothner.com/

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