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. On Jul 26, 2010, at 14:27, Martin DeMello <martindeme...@gmail.com> wrote: > 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) > (c:zero ZERO) > (c:one ONE) > (c:two TWO) > (c:three THREE)) > > This works if I (include "cprog-binding") directly in a scheme file > (see "direct-load.scm"). However, if I want to include it in a module, > then import the module, I cannot access the enum constants, though I > can access ccount->int and int->ccount (see "test.scm"). What's the > right way to do this? > > martin > <test-chicken-modules.tgz> > _______________________________________________ > Chicken-users mailing list > Chicken-users@nongnu.org > http://lists.nongnu.org/mailman/listinfo/chicken-users _______________________________________________ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users