Re: [racket] Introduction to syntax-parse

2013-09-26 Thread Carl Eastlund
On Wed, Sep 25, 2013 at 7:59 AM, Sam Tobin-Hochstadt wrote: > On Wed, Sep 25, 2013 at 2:14 AM, Konrad Hinsen > wrote: > > > > > Maybe making the error message more specific like "Did you forget to > (require > > > (for-syntax syntax/parse)) ?" ? Or is it too specific? > > > > It would already h

Re: [racket] Introduction to syntax-parse

2013-09-26 Thread Matthias Felleisen
On Sep 25, 2013, at 7:59 AM, Sam Tobin-Hochstadt wrote: > I think the error message could be better Yes. Please. Racket Users list: http://lists.racket-lang.org/users

Re: [racket] Introduction to syntax-parse

2013-09-25 Thread Greg Hendershott
Without actually `require`-ing syntax-parse, could syntax-rules and syntax-case simply report this one special case differently? If the specific not-expression is the exact syntax `_`, then report not-an-expression (as usual) but also add the p.s. "Are you trying to use syntax-parse? " Maybe

Re: [racket] Introduction to syntax-parse

2013-09-25 Thread Sam Tobin-Hochstadt
On Wed, Sep 25, 2013 at 2:14 AM, Konrad Hinsen wrote: > > > Maybe making the error message more specific like "Did you forget to > (require > > (for-syntax syntax/parse)) ?" ? Or is it too specific? > > It would already help a lot if the error message said something about > syntax-parse being u

Re: [racket] Introduction to syntax-parse

2013-09-24 Thread Konrad Hinsen
Stephen Chang writes: > You need (require (for-syntax syntax/parse)) because you are using it inside > a > define-syntax. Ahhh... that does it, thanks! Laurent writes: > How much work would be required to prevent people from falling into it ever > again? > Maybe saying so in the doc

Re: [racket] Introduction to syntax-parse

2013-09-24 Thread Ryan Culpepper
You really do need to know a little bit about phases in order to develop macros in Racket, so just putting a band-aid on the issue wouldn't be much help, and the apparent departure from the normal rules would just make it more difficult to understand phases by looking at the requires of a worki

Re: [racket] Introduction to syntax-parse

2013-09-24 Thread Sam Tobin-Hochstadt
If you look in the Typed Racket implementation, you'll see lots phase-1 only uses of syntax-parse. Sam On Sep 24, 2013 3:21 PM, "Nick Sivo" wrote: > Why doesn't syntax/parse just provide everything at phases 0 and 1 > like the module 'sp below: > > (module sp racket/base > (require syntax/pars

Re: [racket] Introduction to syntax-parse

2013-09-24 Thread Nick Sivo
Why doesn't syntax/parse just provide everything at phases 0 and 1 like the module 'sp below: (module sp racket/base (require syntax/parse (for-syntax syntax/parse)) (provide (all-from-out syntax/parse) (for-syntax (all-from-out syntax/parse (require 'sp) (define-sy

Re: [racket] Introduction to syntax-parse

2013-09-24 Thread Laurent
This is a quite common pitfall into which I have myself fallen a few times, and I guess it's not the last time. How much work would be required to prevent people from falling into it ever again? Maybe saying so in the docs at the right place wouldn't hurt, but people may still miss it. Maybe makin

Re: [racket] Introduction to syntax-parse

2013-09-24 Thread Stephen Chang
You need (require (for-syntax syntax/parse)) because you are using it inside a define-syntax. On Sep 24, 2013 11:56 AM, "Konrad Hinsen" wrote: > Hi everyone, > > I am trying to learn about syntax-parse, starting with the introduction > of the "Syntax" documentation. > > Unfortunately, the very fi