Re: [racket-users] Re: Macro behaves differently when run from different modules

2019-09-30 Thread Jonathan Simpson
Ah, I get it now. Thanks for the explanation! -- Jonathan On Monday, September 30, 2019 at 9:45:34 AM UTC-4, Michael Ballantyne wrote: > > Two identifiers that are both unbound and have the same symbol are > considered free-identifier=?. Thus the match works when testing from > expander-utils.r

Re: [racket-users] Re: Macro behaves differently when run from different modules

2019-09-30 Thread Michael Ballantyne
Two identifiers that are both unbound and have the same symbol are considered free-identifier=?. Thus the match works when testing from expander-utils.rkt, where both the pattern and usage are unbound. It also works from expander-utils.rkt when you define `line` in that file, because the patter

Re: [racket-users] Re: Macro behaves differently when run from different modules

2019-09-29 Thread Jonathan Simpson
In expander-utils.rkt the macros work if the line pattern is a datum or literal. In expander.rkt it only works if the line pattern is a datum. So I changed line to only match a datum. From my understanding, I think matching line as a datum is correct, so I'm happy with what I have now. I just do

Re: [racket-users] Re: Macro behaves differently when run from different modules

2019-09-28 Thread Ben Greenman
On 9/28/19, Jonathan Simpson wrote: > It works when I change my mag-line syntax class to: > > (define-syntax-class mag-line > (pattern (line expr ...))) > > So removing the literal specifier on line seems to work. I'm still not sure > why the two modules behave differently though. It seemed to

[racket-users] Re: Macro behaves differently when run from different modules

2019-09-28 Thread Jonathan Simpson
It works when I change my mag-line syntax class to: (define-syntax-class mag-line (pattern (line expr ...))) So removing the literal specifier on line seems to work. I'm still not sure why the two modules behave differently though. It seemed to work in expander-utils.rkt whether line was de