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

Re: [Scheme-reports] (read|write)-char [was Opinion about R7RS]

Hash: SHA1

On 07/14/2012 04:04 PM, Arthur A. Gleckler wrote:
> On Wed, Jul 11, 2012 at 2:57 PM, Jean-Michel HUFFLEN

>> Let us go back to characters. You do not want to give any 
>> priviledge to a particular encoding. OK. How can I write
>> portable code, running on several interpreters? Some characters
>> may be not included in the encoding used for writing characters.
>> How can I make sure that I will avoid errors? For me, if I had: -
>> a function returning the default encoding used, - a function
>> returning the available encodings, I would be the happiest
>> programmer.

> I like the idea, but that's exactly the kind of thing that should
> be in the larger Scheme specified by working group two, not in the
> smaller Scheme standard we're working on at the moment.  Things
> like first-class representations for character encodings are like
> yarn -- if you keep pulling, eventually the whole sweater is
> undone.

It seems to me that we should not be thinking about the encoding
of characters, regardless of small or large lang, until it is
time to do I/O.

While processing strings with scheme code, it is sufficient to
consider a string as a sequence of characters.  If you are worried
about the encoding, it's because you're doing something that does not
use the string as a sequence of characters, like being worried about
the layout of bits in bignums.

It is at the interfaces to the outside world that encoding becomes
important; when we have a bunch of bits that we've read from a binary
port and we want to convert it into a string value, or when we have
to write a string that something which reads in a particular encoding
will understand, or etc.

That said, it is reasonable to wish for a way of knowing whether a
particular character is in the repertoire that can be encoded/decoded
by an encoding.

Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/


Scheme-reports mailing list