Alex Shinn scripsit:

> The clean way to handle this is to duplicate the useful string
> APIs for bytevectors.  This could be done without code duplication
> with the use of functors, though compiler assistance may be
> needed for efficiency (e.g. for inlined procedures).  Even without
> code duplication there would be an increase in the core library
> size, though we could probably move most utilities to external
> libraries (how often do you need regexps that operate on binary
> data?).

+1.  This is what Python 3.x does to help manage the same transition: the
only string APIs that don't have bytevector counterparts are formatting,
string-to-bytevector conversion, and a few others.  This API is also
useful for dealing with binary protocols that have ASCII parts.

If I understand the docs correctly, the Python regular expression module
handles both strings and bytevectors, but a match target and the pattern
being matched must have the same type.

-- 
John Cowan          http://www.ccil.org/~cowan        [email protected]
And through this revolting graveyard of the universe the muffled,
maddening beating of drums, and thin, monotonous whine of blasphemous
flutes from inconceivable, unlighted chambers beyond Time; the
detestable pounding and piping whereunto dance slowly, awkwardly, and
absurdly the gigantic tenebrous ultimate gods --the blind, voiceless,
mindless gargoyles whose soul is Nyarlathotep. (Lovecraft)

_______________________________________________
Chicken-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to