Re: [racket-users] Correct use of pattern-expander (example in docs is broken)

2015-11-11 Thread Thomas Dickerson
On Tuesday, November 10, 2015 at 10:38:35 PM UTC-5, Alex Knauth wrote: > Ok, I just opened https://github.com/racket/racket/pull/1133, which fixes > this so that syntax-rules still works. Awesome! > > On Nov 10, 2015, at 6:19 PM, Alex Knauth wrote: > > This works though:

[racket-users] Correct use of pattern-expander (example in docs is broken)

2015-11-10 Thread Thomas Dickerson
The docs (http://docs.racket-lang.org/syntax/stxparse-patterns.html#%28def._%28%28lib._syntax%2Fparse..rkt%29._pattern-expander%29%29) give an example, ~maybe, that doesn't actually work: > (define-syntax ~maybe (pattern-expander (syntax-rules () [(~maybe pat ...)

Re: [racket-users] Correct use of pattern-expander (example in docs is broken)

2015-11-10 Thread Alex Knauth
Oh, oops. I hadn't realized that syntax-rules using syntax-protect could cause problems. This works though: (define-syntax ~maybe (pattern-expander (lambda (stx) (syntax-case stx () [(~maybe pat ...) #'(~optional (~seq pat ...))] I'll open a pull request to fix

Re: [racket-users] Correct use of pattern-expander (example in docs is broken)

2015-11-10 Thread Alex Knauth
Ok, I just opened https://github.com/racket/racket/pull/1133, which fixes this so that syntax-rules still works. > On Nov 10, 2015, at 6:19 PM, Alex Knauth wrote: > > Oh, oops. I hadn't realized that syntax-rules using syntax-protect could > cause problems. > > This