Skip to content

Need to expand expressions in an expression context #91

@quasarbright

Description

@quasarbright

If we do this

  (nonterminal/exporting class-form
    #:allow-extension racket-macro
    (field name:field-var ...)
    #:binding [(export name) ...]
    ((~literal define-values) (m:method-var) p:method-procedure)
    #:binding (export m)

    ((~literal define-syntaxes) (x:racket-macro ...) e:expr)
    #:binding (export-syntaxes x ... e)

    ((~literal begin) e:class-form ...)
    #:binding [(re-export e) ...]
    e:racket-expr)
  
  (nonterminal method-procedure
    #:allow-extension racket-macro
    ((~literal #%expression) p:method-procedure)
    (lambda:lambda-id (arg:racket-var ...) body:racket-body ...)
    #:binding (scope (bind arg) ... (import body) ...))

Then we get caught in an infinite loop when expanding a method definition. Expanding the lambda for the method procedure wraps it in #%expression, but trying to get around that with the first production of method-procedure just causes an infinite loop because the p gets wrapped again before expanding.

We think this is because some macro is checking syntax-local-context and it is not an expression context, so it's wrapping the lambda with #%expression

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions