Here's some code I'm using to test various module features (attached,
and at http://github.com/martindemello/test-chicken-modules)
In cprog-binding.scm, I define a binding to a C enum via:
(define-foreign-enum-type (ccount int)
(ccount->int int->ccount)
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:
(defi
On Tue, Jul 27, 2010 at 1:20 AM, Jim Ursetto 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 proced
[re-adding cc: to chicken-users, my fault]
If you merely need the constant values, what you probably want is:
(define c:zero (foreign-value "ZERO" int))
(define c:one (foreign-value "ONE" int))
(define c:two (foreign-value "TWO" int))
define-foreign-enum-type is for automatic conversion between