[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Octet vs Char (Re: strings draft)
From my understanding there are a few issues being discussed here
(with possibly overlapping consequences) -- O(1) performance of
strings and using strings for octet sequences.
SRFI-4 defines homogenous numeric vectors which seem like they would
suffice for implementing octet streams independant of strings and, if
not, a few Scheme implementations (larceny, MIT/GNU-scheme) provide
byte-vectors.
As for O(1) performance, there's undoubtably a need for
non-O(1)-string-like-heavy-weight-objects (herein called ropes) which
some implementations choose to implement and call them strings (as
permitted by r5rs). The current proposal seems to urge
implementations to provide these as a seperate data type.
Two reasons for this distinction seem to be:
~ efficiency
Carrying around the full weight of a rope for all strings might be
too excessive, but then r5rs doesn't define the concept of a
fixnum which most implementations utilize to avoid needing to
provide heap allocated bignums.
~ use in binary I/O
relating back to the discussion above -- should an alternative
idiom be employed for this rather than reusing strings for this
purpose.
-jivera