scsh-users
[Top] [All Lists]

Re: Chars and Bytes in the RM

To: RT Happe <rthappe@web.de>
Subject: Re: Chars and Bytes in the RM
From: Martin Gasbichler <gasbichl@informatik.uni-tuebingen.de>
Date: Thu, 02 Jan 2003 19:35:49 +0100
Cc: <scsh@zurich.ai.mit.edu>
>>>>> "RT" == RT Happe <rthappe@web.de> writes:

RT> Suppose we want to read the first bytes of a binary file and compare
RT> these with given values, the magic number of a file format or whatever.
RT> According to my literal and perhaps somewhat dumb (or blind) reading of
RT> the Scsh and S48 manuals + the Scheme report, we have to make do with
RT> read-string and char<->integer conversion.  However, the manuals don't
RT> seem to say, whether or when we may identify characters (elements of
RT> strings) with bytes (octets), and how char->integer represents characters
RT> as integers (besides preserving order).  Char->ascii makes the
RT> representation explicit, but I would nonetheless prefer the manual to be
RT> more specific, and possibly scsh to provide i/o procedures for byte
RT> vectors.

The file doc/io.txt contains a description of the I/O system of Scheme
48. It doesn't contain a direct specification of the character
representation either but it mentions the procedure read-block from
i/o which can be used to read into a byte-vector. There should
probably be byte-vector versions of scsh's read/write-string and
friends.

I think the integration of io.txt into the S48 manual would be the
right place to say something about this issue.

-- 
Martin

<Prev in Thread] Current Thread [Next in Thread>