chicken-users
[Top][All Lists]
Advanced

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

[Chicken-users] FILE* interface


From: Peter Keller
Subject: [Chicken-users] FILE* interface
Date: Wed, 3 Jul 2002 01:06:47 -0500
User-agent: Mutt/1.2i

Hello,

What are your thoughts on implementing a FILE* interface for chicken?

For example, I have some functions that looks like this:

Emit a string representation of op in base to stream.
size_t mpq_out_str(FILE *stream, int base, mpq_t op);

Read a string representation of op in base from stream.
size_t mpq_inp_str(mpq_t, FILE *stream, int base);

How would you represent these nicely with file i/o in chicken?

Also:

The size_t still makes me jittery with chicken. I'm still not sure how I feel
about not handling typedefs natively.

(define-foreign-type pid_t
        (typedef "pid_t"))

has a nice ring to it. :) But I'm not sure how to implement this.

I think I'd just have to do:

(define-foreign-type size_t int)

but that sorta defeats the purpose of <sys/types.h> providing this for you 
automatically on each architecture you wish to use. Maybe there is a way to
automate this and provide a chicken interface for it, like:

(include "unix/sys/types.sch")

where types.sch is automatically provided for you when you build the system
and is found automatically during the compilation process. It would hold
all sorts of definitions for things like size_t and what not. Just an idea.

Thanks.

-pete




reply via email to

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