>>>>> "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
|