Opened 10 years ago
Last modified 2 years ago
#1294 closed defect
define-record-printer messes with internal defines — at Version 4
| Reported by: | sjamaan | Owned by: | |
|---|---|---|---|
| Priority: | major | Milestone: | someday |
| Component: | expander | Version: | 4.11.0 |
| Keywords: | Cc: | ||
| Estimated difficulty: | hard |
Description (last modified by )
As pointed out by russelw on IRC, the following program fails to compile (and doesn't work in the interpreter, either):
(module main () (import chicken) (import scheme) (define (h) (define (f) (g)) (define-record-printer (foo x port) #f) (define (g) (f))))
Change History (4)
comment:1 by , 10 years ago
comment:2 by , 10 years ago
Actually, the snippet above doesn't work in CHICKEN either; the compiler bails out when wrapped in a module, and if you insert a call to (g), it will die at runtime with a "unbound variable: g".
So perhaps it simply needs better error reporting? Other Schemes complain that the define for g is invalid.
comment:3 by , 9 years ago
| Estimated difficulty: | → hard |
|---|
comment:4 by , 9 years ago
| Description: | modified (diff) |
|---|
Note:
See TracTickets
for help on using tickets.

The problem here is that
define-record-printerisn't a true definition. This code is comparable to the following:Other Schemes will bail out on this, complaining that the definition of
gis misplaced. CHICKEN accepts it, so the code from the ticket body should probably also be accepted.