[r6rs-discuss] [Formal] String positions and string slices
cph at csail.mit.edu
Tue Apr 10 00:11:27 EDT 2007
John Cowan wrote:
> Chris Hanson scripsit:
>> Given this view, I think that strings should be read-only, and that
>> operations like string-length and string-ref are a bad idea.
> I like that idea too, but I wanted to maintain as much backward
> compatibility as practical.
I think the best way to retain backward compatibility is to create a new
text abstraction in parallel with the historical strings. The
historical string abstraction should remain vectors of 8-bit (or 7-bit)
characters with side effects. The new text abstraction should be based
on Unicode. I think trying to bridge the difference between these two
with a hybrid approach has little to recommend it.
> That eliminates any chance of them being lightweight fixnums.
I'm not that interested in the lightweight-fixnum optimization (at the
moment, at least), but Taylor has pointed out to me that positions
should be valid in slices as well as in the text they are sliced from.
That argument has sold me.
More information about the r6rs-discuss