Re: [racket-users] Problem controlling macro expansion

2019-01-27 Thread Jonathan Simpson
Thanks. I think I have a better approach now, thanks to your earlier comments. There are still some issues to work out, but I think I'm on the right track! -- Jonathan On Sunday, January 27, 2019 at 5:18:04 PM UTC-5, Matthias Felleisen wrote: > > > See docs for local-expand. > > > On Jan 27, 2

Re: [racket-users] Problem controlling macro expansion

2019-01-27 Thread Jonathan Simpson
I gave this a try and it appears to break my parse-to-tree function. Thanks for the warning though. Once I get this working it will be worth going back to this. Thanks, Jonathan On Sunday, January 27, 2019 at 5:03:17 PM UTC-5, Jens Axel Søgaard wrote: > > > > Den søn. 27. jan. 2019 kl. 22.06 sk

Re: [racket-users] Problem controlling macro expansion

2019-01-27 Thread Matthias Felleisen
See docs for local-expand. > On Jan 27, 2019, at 5:15 PM, Jonathan Simpson wrote: > > The code contained within lines-to-syntax-tree will run tests on an input > stream. My original plan was to have a function like run-query that would > execute the tests. So I'd need to quote the tests bec

Re: [racket-users] Problem controlling macro expansion

2019-01-27 Thread Jonathan Simpson
The code contained within lines-to-syntax-tree will run tests on an input stream. My original plan was to have a function like run-query that would execute the tests. So I'd need to quote the tests because they'd be executed in an order defined by run-query. I will look into making run-query a

Re: [racket-users] Problem controlling macro expansion

2019-01-27 Thread Jens Axel Søgaard
Den søn. 27. jan. 2019 kl. 22.06 skrev Jonathan Simpson : > I'm having macro troubles with a DSL I'm writing. I have a macro that > looks something like this: > > (define-syntax (query stx) > (let ([lines (cdr (syntax->datum stx))]) > (define lines-syntax-tree (parse-to-tree lines)) > (d

Re: [racket-users] Problem controlling macro expansion

2019-01-27 Thread Matthias Felleisen
Why is run-query not a macro and if it were, why would you quote lines-to-syntax-tree? > On Jan 27, 2019, at 4:06 PM, Jonathan Simpson wrote: > > I'm having macro troubles with a DSL I'm writing. I have a macro that looks > something like this: > > (define-syntax (query stx) > (let ([lin

[racket-users] Problem controlling macro expansion

2019-01-27 Thread Jonathan Simpson
I'm having macro troubles with a DSL I'm writing. I have a macro that looks something like this: (define-syntax (query stx) (let ([lines (cdr (syntax->datum stx))]) (define lines-syntax-tree (parse-to-tree lines)) (datum->syntax stx lines-syntax-tree))) So something like (query ...li