[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] using constants from define-foreign-enum-type via a
Re: [Chicken-users] using constants from define-foreign-enum-type via a module
Tue, 27 Jul 2010 01:50:03 +0530
On Tue, Jul 27, 2010 at 1:20 AM, Jim Ursetto <address@hidden> wrote:
> The right way is to use include, foreign variables are not visible outside
> the compilation unit they are declared in.
> Alternatively if you want a user accessible interface to the constants, and
> do not want to use the conversion procedures, use regular old define and
> export that binding:
> (define zero c:zero) ; then export zero
> In short, if this is for internal use, use include. If it is for users, write
> a nice API for them.
Thanks. If you're taking feature requests, it would be useful to have
an option to define-foreign-enum-type to create the exportable
bindings automatically too, for use cases like mine (I'm writing
bindings to a C library, so the enums are typically more useful to my
users than they are within the binding code).