Macro expansion to (include ...) not working to export bindings inside a library
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Ikarus Scheme |
Fix Released
|
Low
|
Abdulaziz Ghuloum |
Bug Description
I'm working on porting SRFIs and I made an include/resolve which searches the library-path so the original reference implementation files can be included into the library, and I ran into the below problem. Macro expanding to include in the top-level interaction environment works and makes the bindings available, but when it's done in a library the bindings aren't able to be exported. It doesn't seem to be a problem with (begin ...) splicing; maybe the problem has something to do with include being a built-in macro?
$ cat to-include.scm
(define x 123)
(define y 54321)
(define (f z) (+ x y z))
(define-syntax s (syntax-rules () [(_ a) '(a a a)]))
$
$ ikarus
Ikarus Scheme version 0.0.2patched+ (revision 1181, build 2007-12-03)
Copyright (c) 2006-2007 Abdulaziz Ghuloum
> (library (include-it)
(export include-it)
(import (ikarus))
(define-syntax include-it
(lambda (stx)
[(_) #'(include "to-include.
>
> (library (hmm)
(export x y f s)
(import (rnrs) (include-it))
(include-it))
Unhandled exception
Condition components:
1. &error
2. &who: expander
3. &message: "cannot export unbound identifier"
4. &irritants: (s)
>
description: | updated |
Changed in ikarus: | |
status: | Fix Committed → Fix Released |
Okay, it has nothing to do with a macro expanding to include. I should have tried this first:
$ cat to-include.scm
(define x 123)
(define y 54321)
(define (f z) (+ x y z))
(define-syntax s (syntax-rules () [(_ a) '(a a a)]))
$ ikarus
Ikarus Scheme version 0.0.2patched+ (revision 1181, build 2007-12-03)
Copyright (c) 2006-2007 Abdulaziz Ghuloum
> (library (hmm)
(export (x y f s))
(import (rnrs) (only (ikarus) include))
(include "to-include.scm"))
Unhandled exception
Condition components:
1. &error
2. &who: expander
3. &message: "invalid export"
4. &irritants: ((x y f s))
>