racket / racket/racket

all-defined-out doesn't seem to work well with macro

Open
#2,676 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Racket
Stars
5.2k
Forks
698
Avg merge
18h 34m
Merged PRs (30d)
5

Description

When running the following a.rkt, I get the expected result:

#lang racket

(provide module++)
(require syntax/parse/define)

(define-simple-macro (module++ name base xs ...)
  (module name base
    (provide (all-defined-out))
    xs ...))

(module++ bar racket/base
          (define a 2))

(require 'bar)
a ;=> 2

However, running b.rkt, which uses module++ in a.rkt, fails.

#lang racket

(require my/a)

(module++ foo racket/base
          1)
provide: identifier's binding is ambiguous
  context...:
  matching binding...:
  matching binding...:
  matching binding...: in: provide

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the difference between a.rkt, which uses module++ locally, and b.rkt, which requires my/a before using module++; inspect the syntax/parse/define macro and the generated module's provide (all-defined-out). Done means the module++ expansion can be used from another module without the ambiguous-binding error.

Written by the indexing model from the issue text.

Assessment

Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.