Opened 5 years ago

Closed 4 years ago

#326 closed defect (fixed)

Add destructive list-copy!, string-copy!, and vector-copy!

Reported by: cowan Owned by: cowan
Priority: major Milestone:
Component: WG1 - Core Keywords:
Cc:

Description

From Per Bothner:

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 and unboxing the characters). [JC: Many implementations represent characters as immediates, 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 [with start/end arguments] and string-copy! are the actual useful "primitive" operations.

JC: These would be the five-argument versions based on the current bytevector-copy-partial!, possibly with renumbering of arguments depending on the outcome of #325.

Change History (4)

comment:1 Changed 5 years ago by cowan

The WG voted to adopt the part of this proposal covering string-copy! and vector-copy!, but not list-copy!.

comment:2 Changed 5 years ago by cowan

  • Status changed from new to decided

comment:3 Changed 5 years ago by cowan

  • Owner changed from alexshinn to cowan
  • Status changed from decided to writing

comment:4 Changed 4 years ago by cowan

  • Resolution set to fixed
  • Status changed from writing to closed
Note: See TracTickets for help on using tickets.