[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Chicken-users] Exporting proc and macro that references it?
From: |
Alejandro Forero Cuervo |
Subject: |
[Chicken-users] Exporting proc and macro that references it? |
Date: |
Mon, 5 Jul 2010 13:04:02 +0200 |
User-agent: |
Mutt/1.5.13 (2006-08-11) |
I have a module embedded-test that exports a procedure called
'register' and a macro called 'test' that transforms a form into a
call to 'register'. It looks like this (I'm simplifying a lot):
(module embedded-test (test register)
(import chicken scheme)
(define (register) #f)
(define-syntax test (syntax-rules () ((test) (register))))
)
I install the extension and can use it from csi without problems but
when I try the following compiled program,
(use embedded-test)
(test)
I get:
Error: unbound variable: embedded-test#register
Call history:
embedded-test#register <--
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)?
In case the answer is of the form "Chicken does not support this, what
are you trying to do?", what I'm trying to do is let the programmer
say things like (test (+ 2 3) 5) and have that transformed into
something like (register-test '(+ 2 3) (lambda () (+ 2 3)) (lambda ()
5) equal?). If there are better ways to do this, I'm all ears.
For my format-compiler, I workarounded the let-optionals bug by
renaming 'rest' to 'rest-xrenamed' throughout my code but now I'm
stuck with this problem. Any help would be appreciated.
Thanks!
Alejo.
http://azul.freaks-unidos.net/
- [Chicken-users] Compiling files that 'import' eggs that aren't installed?, Alejandro Forero Cuervo, 2010/07/03
- [Chicken-users] Re: Compiling files that 'import' eggs that aren't installed?, Alejandro Forero Cuervo, 2010/07/03
- Re: [Chicken-users] Compiling files that 'import' eggs that aren't installed?, Thomas Chust, 2010/07/03
- [Chicken-users] Re: Compiling files that 'import' eggs that aren't installed?, Felix, 2010/07/03
- [Chicken-users] Re: Compiling files that 'import' eggs that aren't installed?, Alejandro Forero Cuervo, 2010/07/04
- [Chicken-users] How to load an extension?, Alejandro Forero Cuervo, 2010/07/04
- [Chicken-users] bug in let-optionals in 4.5.0?, Alejandro Forero Cuervo, 2010/07/04
- [Chicken-users] Exporting proc and macro that references it?,
Alejandro Forero Cuervo <=
- Re: [Chicken-users] Exporting proc and macro that references it?, Peter Bex, 2010/07/05
- Re: [Chicken-users] Exporting proc and macro that references it?, Alejandro Forero Cuervo, 2010/07/05
- Re: [Chicken-users] Exporting proc and macro that references it?, Peter Bex, 2010/07/05
- Re: [Chicken-users] Exporting proc and macro that references it?, Alejandro Forero Cuervo, 2010/07/05
- Re: [Chicken-users] Exporting proc and macro that references it?, Alejandro Forero Cuervo, 2010/07/05
- Re: [Chicken-users] Exporting proc and macro that references it?, Stephen Eilert, 2010/07/05
- Re: [Chicken-users] Exporting proc and macro that references it?, Felix, 2010/07/05
- Re: [Chicken-users] Exporting proc and macro that references it?, Alejandro Forero Cuervo, 2010/07/05
- Re: [Chicken-users] bug in let-optionals in 4.5.0?, Felix, 2010/07/05
- Re: [Chicken-users] bug in let-optionals in 4.5.0?, Alejandro Forero Cuervo, 2010/07/05