chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] UTF-8 support in eggs


From: John Cowan
Subject: Re: [Chicken-users] UTF-8 support in eggs
Date: Thu, 10 Jul 2014 02:51:37 -0400
User-agent: Mutt/1.5.20 (2009-06-14)

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        address@hidden
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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]