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

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



-----BEGIN PGP SIGNED MESSAGE-----
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.

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

iQEcBAEBAgAGBQJQAwylAAoJEAOzWkqOibfNtHgH+wfpdyG11lWWBDsCFcn61JSF
PiA5LviPpoU8zU3Vhn9llCwQ3SxnbCZDj9ZvozVhpeBsjDMUSoNoqj0W+iVpVG6G
NS7Obi/chdEIpMs33BsKeQyWJ/T09dzZm/fuMCJh1sul/u9YLo8jOGgq2CAxo857
g+CsutixBLWBtiesrPm3JD+Er0O1G/ENroaFS+3STRRtr9TK+EU8GvJgMLTdLHS6
XNzac18NDpJhZjeCDgV9XoRWNfC9o7WJUWp9mlFPLT6RIS5KKBIKvUCQLudhnMI4
QMhdGoNI5slT8qOLEUuF7uZe/w+Hvu59TDYpMl9yOj9aal5TKLxUqT+cmPoNy+8=
=DYN3
-----END PGP SIGNATURE-----

_______________________________________________
Scheme-reports mailing list
Scheme-reports@x
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports