chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] endian-port


From: Ivan Raikov
Subject: Re: [Chicken-users] endian-port
Date: Tue, 23 Feb 2010 12:52:18 +0900
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.3 (gnu/linux)

Hello,


   Actually, the endian-blob egg in Chicken 4 is meant to take over the
functionality of endian-port. Your port of endian-port would probably
have to rely on the wrappers generated by swig, which are not especially
readable or maintainable. Unfortunately, I don't have Chicken 3
installed anymore, so I cannot help with this particular problem, but
take a look at endian-blob and let me know if it would be suitable for
your needs. 


   -Ivan


Shawn Rutledge <address@hidden> writes:

> I'm having trouble reading back a float from a file that I just wrote:
>
> (use endian-port)
>
> (let ([outp (port->endian-port (open-output-file "eptest"))])
>       (endian-port-write-ieee-float32 outp 5.25)
>       (close-endian-port outp))
>
> (let ([inp (port->endian-port (open-input-file "eptest"))])
>       (print (endian-port-read-ieee-float32 inp))
>       (close-endian-port inp))
>
> it returns #f.
>
> This was with chicken 3, but I managed to compile that egg for chicken
> 4 as well, and it acts the same:
>
> /usr/bin/csc -feature compiling-extension -setup-mode   -O2 -d0 -s -o
> endian-port.so endian-port.scm endian_lowio_wrap.c endian_lowio_lib.c
> floatformat.c endian_lowio.scm -lchicken -ldl -lm
>
> #;1> (load "endian-port.so")
> ; loading endian-port.so ...
> ; loading /usr/lib64/chicken/4/iset.so ...
>
> so apparently porting that egg is going to be fairly trivial.  Maybe
> I'll give it a shot if someone will create the directory under
> release/4?
>
>
> Functions like endian_lowio_read_int8 return by value, but
> endian_lowio_read_ieee_float32 set a value into a passed pointer, so
> wonder why that is... anyway seems to be where the problem is.  Maybe
> it's done that way because of NaN?  But usually NaN is a valid value,
> and can be tested for with isnan().




reply via email to

[Prev in Thread] Current Thread [Next in Thread]