Summary
Module system weirdness
Metadata
- Id: 964fd0b6b6caba76ead7d638a038b119bd6f3df0
- Trac id: 1759
- Type: defect
- Reporter: Idiomdrottning
- Owner:
- Cc:
- Status: new
- Component: unknown
- Estimated difficulty:
- Resolution:
- Priority: major
- Milestone: someday
- Version: 5.2.0
- Changetime: 2021-06-01 18:18:40 UTC
- Created: 2021-06-01 18:18:40 UTC
- Keywords:
Description
So the trippy thing is that if I start a fresh REPL and
(import brev-separate)
without importing matchable nor import-for-syntax anything, define-ir-syntax* works.
When I try to do that inside a module, it doesn't work.
define-ir-syntax* is a macro that makes macros, using matchable to do so.
OK, so let me try something else:
When I make a file not in a module but just something.scm and in that file only put:
(import brev-separate) (define-ir-syntax* (jolly) '(print "This is jolly good")) (jolly)
and then csc it and run it, it works.
But inside of a module it does not work. I need (import-for-syntax matchable).
This behavior, I don't know if it's a bug or not but it was unintuitive enough to send me on an 8 hour rabbit hole trek.
Which is fine. I was embarrassed in the IRC channel but I'm glad everyone was cool.
I wish I understood the module system better. I feel like I'm just klutzing around, testing out what works and doesn't work.