Re: [racket-users] Help debugging a custom language read/expansion error

2018-12-30 Thread Matthew Butterick
> On Dec 30, 2018, at 8:41 PM, Jonathan Simpson wrote: > > I'm doing #1, so I think #2 is the explanation. 'type' is a function > available in expander.rkt so the literal will only match that binding. The > same is true for 'offset'. Both need to be provided. 'test' is not bound to > anythin

Re: [racket-users] Help debugging a custom language read/expansion error

2018-12-30 Thread Jonathan Simpson
On Sunday, December 30, 2018 at 8:51:25 PM UTC-5, Matthew Butterick wrote: > > Without seeing "reader.rkt" or "expander.rkt" — I'd guess that: > > 1) `read-syntax` isn't stripping all bindings from its parse tree before > returning it. Though this isn't mandatory, it's a wise practice to avoid

Re: [racket-users] Help debugging a custom language read/expansion error

2018-12-30 Thread Matthew Butterick
> On Dec 30, 2018, at 3:13 PM, Jonathan Simpson wrote: > > Adding a '(provide type)' in expander.rkt (where 'line' is defined) gets me > past this error. Strangely, providing 'compare' or 'offset' doesn't seem to > be necessary. I'm interested in any theories as to why this might be the case.

Re: [racket-users] Help debugging a custom language read/expansion error

2018-12-30 Thread Jonathan Simpson
Adding a '(provide type)' in expander.rkt (where 'line' is defined) gets me past this error. Strangely, providing 'compare' or 'offset' doesn't seem to be necessary. I'm interested in any theories as to why this might be the case. Thanks for your help. -- Jonathan On Sunday, December 30, 2018

Re: [racket-users] Help debugging a custom language read/expansion error

2018-12-30 Thread Jens Axel Søgaard
Den søn. 30. dec. 2018 kl. 22.33 skrev Jonathan Simpson : > On Sunday, December 30, 2018 at 3:58:50 PM UTC-5, Jens Axel Søgaard wrote: > >> The error >> >> line: bad syntax >> (line (offset 0) (type (string8 "string")) (test (strtest "MZ"))) >> >> means that the macro `line` doesn't have a

Re: [racket-users] Help debugging a custom language read/expansion error

2018-12-30 Thread Jonathan Simpson
On Sunday, December 30, 2018 at 3:58:50 PM UTC-5, Jens Axel Søgaard wrote: > The error > > line: bad syntax > (line (offset 0) (type (string8 "string")) (test (strtest "MZ"))) > > means that the macro `line` doesn't have a clause that matches the input. > > How is line defined? > > /Jens A

Re: [racket-users] Help debugging a custom language read/expansion error

2018-12-30 Thread Jens Axel Søgaard
The error line: bad syntax (line (offset 0) (type (string8 "string")) (test (strtest "MZ"))) means that the macro `line` doesn't have a clause that matches the input. How is line defined? /Jens Axel Den søn. 30. dec. 2018 kl. 21.27 skrev Jonathan Simpson : > I'm bumbling through my f

[racket-users] Help debugging a custom language read/expansion error

2018-12-30 Thread Jonathan Simpson
I'm bumbling through my first attempts at creating a language in Racket and am currently stuck debugging an error in expansion. I have a macro in my expander that works fine until I try to run the language. Here's what the macro stepper in DrRacket gives me: [Error] line: bad syntax (line (o