larcenists / larceny

Larceny Scheme implementation
Other
202 stars 32 forks source link

Library ‘(scheme base)’ exports ‘expand’ macro keyword #747

Closed mnieper closed 7 years ago

mnieper commented 8 years ago

By R7RS, ‘expand’ is not exported by ’(scheme base)’. However:

$ ~/larceny/larceny -r7rs
Larceny v0.98 "General Ripper" (Mar  7 2015 01:06:26, precise:Linux:unified)
larceny.heap, built on Sat Mar  7 01:06:50 EST 2015

> expand

Syntax violation: expand

Reference to macro keyword out of context

Form: expand

Trace: 

  expand

Error: unhandled condition:
Compound condition has these components: 
#<record &who>
    who : expand
#<record &message>
    message : "Reference to macro keyword out of context"
#<record &syntax>
    form : expand
    subform : #f

Entering debugger; type "?" for help.
debug> 
WillClinger commented 8 years ago

Thank you for reporting that. The run keyword probably has this same problem.

WillClinger commented 8 years ago

In Larceny v0.98, a library cannot define and export any of the following identifiers: for, run, expand, meta.

To my surprise, that bug seems to have disappeared in the current development version of Larceny. I don't understand why it disappeared, and will keep this ticket open for a while to remind me of the mystery.

I now see I made the bug disappear by making a temporary change in my working directory that caused other bugs. What I need to do is to remove those reserved words from R7RS define-library contexts while keeping them in R6RS library contexts, which is slightly tricky.

WillClinger commented 8 years ago

Mostly fixed by changeset 30b2960d842c9a017d34717c0560156085ea23e9

Libraries can now define and export for, run, expand, and meta, but still cannot define or export program or primitives (or export etc, but that's less serious).

With the partial fix, I'm downgrading this ticket's priority and will probably change the milestone eventually.

WillClinger commented 7 years ago

Fixed by changeset 582c6082f1bbdfadc29d61e9848037d837b01d63