Re: [q-lang-users] Two proposed improvements to Q
Brought to you by:
agraef
From: John C. <co...@cc...> - 2008-01-21 17:20:50
|
Albert Graef scripsit: > John Cowan wrote: > > What you've got looks good. For strings, I had something in mind like > > > > get_string Bytes EncodingName StartIndex EndIndex > > > > to decode a portion of a byte string into a string, and > > > > put_string Bytes EncodingName Index String > > Should the indices be byte offsets? Also, put_string would just > overwrite the part of the string at the given offset, right? Yes to both questions. > In that > case it should be easy to get that kind of functionality with existing > routines, I just need to add a function to replace a slice of a byte > string in-place. Hmm, right. (I should have re-read the existing docs.) How about this? bytecopy FromByteString FromIndex ToByteString ToIndex Length > > byte_string EncodingName String > > If I understand this correctly, bytestr already provides that > functionality. Yes, you're right. As I said, I should have re-read the existing docs. -- John Cowan co...@cc... http://ccil.org/~cowan If I have not seen as far as others, it is because giants were standing on my shoulders. --Hal Abelson |