This is the mail archive of the guile@cygnus.com mailing list for the guile project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
I'd like to write a guile script to communicate with a program that reads and writes data in binary format - 32 bit numeric values are written as four bytes in host byte order. I can get Guile to read this in as a string of four chars, but is there a reasonably portable way to convert that into a Scheme number (and vice versa for communicating the other way)? I can think of the simple-minded approach of using char->integer on each byte, bitshifting and adding, but I'd rather not put knowledge of the host's endianness into the script, and I'm hoping there's some primitives that can help do it more efficiently, although I don't know of any. - Maciej