Re: [racket-users] Using the top level to fix unbound identifier

2019-11-10 Thread Jonathan Simpson
I just wanted to follow up to say that I finally got this working! I finally re-implemented all of my non-hygienic macros with syntax-parse, which resolved the unbound identifiers. Once again, thanks to everyone who offered help and suggestions. -- Jon On Sunday, August 18, 2019 at 8:01:36 PM

Re: [racket-users] Using the top level to fix unbound identifier

2019-08-18 Thread Jonathan Simpson
Thanks very much for this! I hadn't considered the effect that stripping the syntax information from the input to query would have. It has always been a goal of mine to go back and rewrite all the macros -- and especially the ugly stuff you mentioned in expander-utils.rkt -- with syntax-parse.

Re: [racket-users] Using the top level to fix unbound identifier

2019-08-14 Thread Jonathan Simpson
I will take a look at this as well. It may be a few days before I have time to devote to this again, but I appreciate everyone's help so far. -- Jonathan On Wednesday, August 14, 2019 at 1:00:54 AM UTC-4, Matthew Butterick wrote: > > > On 13 Aug 19, at 7:03 PM, Jonathan Simpson > wrote: > > In

Re: [racket-users] Using the top level to fix unbound identifier

2019-08-13 Thread Matthew Butterick
> On 13 Aug 19, at 7:03 PM, Jonathan Simpson wrote: > > In the following magic code, a new function(called a named query in magic) > tga-image is defined and later used inside the definition of the function > test-scope. The issue is that tga-image is an unbound identifier in > test-scope. If

Re: [racket-users] Using the top level to fix unbound identifier

2019-08-13 Thread Jonathan Simpson
The error during the expansion of use-name in the line macro is the same as what I was seeing before I made the format-id change. I'm running Racket 6.11 so perhaps that explains why I wasn't seeing the problem you were without format-id. I really have no idea, but at least it does look like we

Re: [racket-users] Using the top level to fix unbound identifier

2019-08-13 Thread Tom Gillespie
It is the same error, but I think it is occurring at a different place. Running raco macro-stepper on name-test.rkt the original error was happening in define-values (because format-id was not used). After making the format-id changes it occurs during the expansion of use-name when expanding the l

Re: [racket-users] Using the top level to fix unbound identifier

2019-08-13 Thread Jonathan Simpson
On Tuesday, August 13, 2019 at 10:41:33 PM UTC-4, Jonathan Simpson wrote: > > I changed the lines in named-query from > > [name (datum->syntax stx (string->symbol (syntax->datum #'magic-name))) > to > (format-id stx "~a" (syntax-e #'magic-name)) > > Of course this should be (datum->syntax stx (str

Re: [racket-users] Using the top level to fix unbound identifier

2019-08-13 Thread Jonathan Simpson
I changed the lines in named-query from [name (datum->syntax stx (string->symbol (syntax->datum #'magic-name))) to (format-id stx "~a" (syntax-e #'magic-name)) and I still get the same error. I also switched to using format-id where I use the name, with no change either. Am I using this correctl

Re: [racket-users] Using the top level to fix unbound identifier

2019-08-13 Thread Tom Gillespie
Without have read this carefully, are you maybe looking for https://docs.racket-lang.org/reference/syntax-util.html#%28def._%28%28lib._racket%2Fsyntax..rkt%29._format-id%29%29? If you just pass string->symbol and then use datum->syntax you will get binding errors. Tom On Tue, Aug 13, 2019 at 7:03