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

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



Per Bothner scripsit:

> To my thinking, there are few semantically-meaningful uses of fixed-size
> mutable vectors or strings.  

I agree about strings, but mutability allows very large vectors (particularly
ones that act as backing store for multi-dimensional arrays) to be used even
when their size is close to that of useful memory.

> Regardless, copying a slice from one vector/string into another is
> such a fundamental operation that it should be added, IMO, considering
> that it's tedious to write if "by hand", and that a standard library
> routine is likely to be much more efficient (especially for strings,
> since that avoids the need for boxing+unboxing the characters).

Many implementations use immediates for characters, however.

> One could also argue that "character" operations don't really make
> semantic sense in a Unicode world, and so string-set! has limited
> usefulness.  Thus string-copy and string-copy! are the actual
> useful "primitive" operations.

Good point about strings.  Ticket # filed.

> Well, I suspect vector-copy! has more uses that vector-fill!

No doubt, but we are stuck with vector-fill!.

> > The WG specifically voted in ballot 3 (#205) to keep bytevector-copy and
> > bytevector-copy-partial separate.
> 
> I think that was a mistake, in lieu of the prior art of SRFI-43.
> I also think the shorter names are better regardless.

/me shrugs.  Democracy in action.

-- 
John Cowan              cowan@x          http://www.ccil.org/~cowan
C'est la` pourtant que se livre le sens du dire, de ce que, s'y conjuguant
le nyania qui bruit des sexes en compagnie, il supplee a ce qu'entre eux,
de rapport nyait pas.               --Jacques Lacan, "L'Etourdit"

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