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

Re: [Scheme-reports] bytevector/string/vector comments



I have reordered your text in order (I hope) to clarify my exposition.
Sorry for the long delay in replying!

Per Bothner scripsit:

> bytevector-copy-partial Should add something like (assuming that is
> intended):  It is an error if (< start 0) or (> start end) or (> end
> (bytevector-length bytevector))
>
> Likewise for bytevector-copy-partial!
>
> Note that the introduction of 6.8 Vectors has 2 paragraphs starting
> "Vectors are written using the notation ...". There are no
> corresponding paragraphs in 6.9 bytevectors, but I think there should
> be.

All added to trunk.

> Should perhaps have string-copy!, presumably compatible with SRFI-13.
> Should perhaps have vector-copy!, presumably compatible with SRFI-43.

I think the feeling is that bytevectors will often be used for buffers
and such, and that partial and destructive copy operations are needed
for them but not for the basic types list, string, and vector.  (Per
contra, bytevectors don't get mapping functions or general conversion
operators.)

> (At least if bytevector-vector! is provided.)

I'm not sure what this sentence means.

> string-copy should perhaps have 3-operand option, compatible with
> SRFI-13 and vector-copy.

The WG voted back in ballot 1 (#64) to provide vector-copy "as in SRFI
43" without actually noticing that SRFI 43 vector-copy provides start,
end, and fill arguments.  I did notice at the last minute for draft 5,
and added the cases -- with ticket #310 to cut the small language back
to a simple copier.

> bytevector-copy-partial should be called bytevector-copy for
> compatibility with vector-copy.

The WG specifically voted in ballot 3 (#205) to keep bytevector-copy and
bytevector-copy-partial separate.

> The 2-operand bytevector-copy! seems relatively useless.  Likewise
> (bytevector-copy-partial! from start end to at) should be
> (bytevector-copy! to at from start end) for compatibility with
> SRFI-43.

I'm inclined to agree.  Ticket #325 filed.

-- 
One art / There is                      John Cowan <cowan@x>
No less / No more                       http://www.ccil.org/~cowan
All things / To do
With sparks / Galore                     --Douglas Hofstadter

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