unbound identifier with define-record-type run as file but not in REPL
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Ikarus Scheme |
Fix Released
|
Low
|
Abdulaziz Ghuloum | ||
r6rs-libraries |
New
|
Undecided
|
Unassigned |
Bug Description
Sorry for the arb description :p I am trying to get define-record in psyntax to use define-record-type, and ran into this.
The following runs fine in REPL, but fails when run as file.
$ cat wip.ss
(import
(rnrs))
(define-syntax define-record
(lambda (x)
[(_ name (field* ...) printer)
[(_ name (field* ...))
(sealed #t) ; for better performance
(opaque #t) ; for security
(fields #,@(map
(define-record testr (id name version))
(define tt (make-testr 1 2 3))
(testr-id tt)
$ ikarus --r6rs-script wip.ss
Unhandled exception:
Condition components:
1. &who: testr-id
2. &message: "unbound identifier"
3. &undefined
4. &source-
file-name: "wip.ss"
character: 1429
Changed in ikarus: | |
status: | Fix Committed → Fix Released |
It's a bug in your macro. You're missing a bunch of datum->syntax calls for all the identifiers that you're generating. The bug in the expander is that it's not signaling an error in these cases.