I haven't written any C code for Chicken since version 3 days, and to save
me some time re-learning., I'd like to see if anyone's willing to write
some for me.  What I need is an implementation of the four native IEEE
procedures (single and double ref and set) in the R6RS bytevectors library,
documented at <
http://www.r6rs.org/final/html/r6rs-lib/r6rs-lib-Z-H-3.html#node_sec_2.8>.
I can't find any Scheme implementations that are both portable and portably
accurate (I've experimented with SRFI 56 and the sample R6RS implementation
at r6rs.org).

The contract for the four routines is that they accept a byte vector and an
offset, and read or write an inexact number into the bytevector as 4 or 8
bytes with the native endianism, depending on whether it is an ieee-single
procedure or an ieee-double procedure.  The easiest way to do this in C is
with a couple of unions that map a float or double onto an array of 4 or 8
chars, like these:

union float_map {
  float f;
  char c[4];
}

union double_map {
  double d;
  char c[4];
}

This is in aid of SRFI 160, the proposed heterogeneous vector library for
R7RS-large.  Can anyone help?  Thanks.
_______________________________________________
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to