chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] Exporting proc and macro that references it?


From: Peter Bex
Subject: Re: [Chicken-users] Exporting proc and macro that references it?
Date: Mon, 5 Jul 2010 13:25:51 +0200
User-agent: Mutt/1.4.2.3i

On Mon, Jul 05, 2010 at 01:04:02PM +0200, Alejandro Forero Cuervo wrote:
> 
> Am I doing something wrong?  I've tried various combinations of 'use',
> 'import', 'require-library', 'import-for-syntax' and
> 'require-extension' to no avail.  How does one make a macro transform
> a form into a call to a procedure from its own module (that the module
> exports)?

I didn't get the error you're getting, but I think what you need is this
section from the manual:

"EXPORT may be a symbol or a list of the form
 (IDENTIFIER1 IDENTIFIER2 ...). In the former case the identifier given
 is exported from the module and can be imported at the toplevel or in
 other modules. The latter case exports IDENTIFIER1 (which should name
 a macro) and also arranges for the remaining identifiers in the list
 to be visible in the expansion of the macro (this is a hint to the
 module expander to export bindings referenced by syntax-definitions
 which make use of them, but which would normally be internal to the
 module - which gives more opportunities for optimization)."
                  --- http://chicken.wiki.br/man/4/Modules%20and%20macros

In other words, do (module embedded-test ((test register)) ...)

I think it worked because the code you pasted in the mail also exported
REGISTER, which your real code perhaps does not?

Cheers,
Peter
-- 
http://sjamaan.ath.cx
--
"The process of preparing programs for a digital computer
 is especially attractive, not only because it can be economically
 and scientifically rewarding, but also because it can be an aesthetic
 experience much like composing poetry or music."
                                                        -- Donald Knuth



reply via email to

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