larcenists / larceny

Larceny Scheme implementation
Other
203 stars 32 forks source link

cond-expand failure in (r6rs enums) #733

Closed WillClinger closed 8 years ago

WillClinger commented 9 years ago

With (r6rs no-rnrs) defined:

% ./testr6rs-larceny 
...
enums.sps
./tests/r6rs/run/enums.sps
Trying /home/will/Larceny/LarcenyGit/tools/R6RS/r6rs/lists.body.scm
Reading /home/will/Larceny/LarcenyGit/tools/R6RS/r6rs/lists.body.scm
Trying /home/will/Larceny/LarcenyGit/tools/R6RS/r6rs/sorting.body.scm
Reading /home/will/Larceny/LarcenyGit/tools/R6RS/r6rs/sorting.body.scm
Trying /home/will/Larceny/LarcenyGit/tools/R6RS/r6rs/enums.body.scm
Reading /home/will/Larceny/LarcenyGit/tools/R6RS/r6rs/enums.body.scm

Error: unhandled condition:
Compound condition has these components: 
#<record &assertion>
#<record &who>
    who : "car"
#<record &message>
    message : "car: not a pair: #f \n"

The backtrace shows this error occurred during a call to compress, which is part of Andre van Tonder's macro expander, suggesting this might have something to do with the macro-defining macro in (r6rs enums). The odd thing is that (rnrs enums) works fine if the cond-expand is replaced by an unconditional (include "enums.body.scm"), so there appears to be some weird interaction between cond-expand and the macro expander.

The cond-expand normally implements (r6rs enums) by importing (rnrs enums), which works fine, so this bug is of no great importance for (r6rs enums). It does, however, indicate some kind of bug in a core component of Larceny.

WillClinger commented 8 years ago

Apparently this was indeed fixed by changeset 551d2b02e835ef79a75ad15914e6b8b1eb1685e4