Re: [racket-dev] internal-definition parsing

2010-10-13 Thread Carl Eastlund
On Wed, Jul 7, 2010 at 12:23 PM, Matthew Flatt mfl...@cs.utah.edu wrote: Should an expression be required at the end? A `module', `unit', or `class' body can consist of just definitions. Similarly, if an internal-definition context ends with a definition, we could define the result to be

Re: [racket-dev] internal-definition parsing

2010-10-13 Thread Matthew Flatt
At Wed, 13 Oct 2010 08:23:09 -0400, Carl Eastlund wrote: On Wed, Jul 7, 2010 at 12:23 PM, Matthew Flatt mfl...@cs.utah.edu wrote: Should an expression be required at the end? A `module', `unit', or `class' body can consist of just definitions. Similarly, if an internal-definition context

Re: [racket-dev] internal-definition parsing

2010-10-13 Thread Matthias Felleisen
In a sense you just want to change the 'fault blame' designation when e/d ... moves from macro foo to macro bar so that bar isn't blamed. It is then foo's job to ensure that the sequence isn't empty and foo is blamed when things go wrong. I suspect this can be solved in syntax-parse, too.

Re: [racket-dev] internal-definition parsing

2010-10-13 Thread Carl Eastlund
In the case I have, though, I want the sequence to be empty. The problem is that these bodies -- (let () ...), (parameterize () ...), etc. -- are used for a lot of different things. A macro may splice in a sequence that is intended to represent definitions to bind in a scope, expressions to

Re: [racket-dev] internal-definition parsing

2010-10-13 Thread Joe Marshall
On Wed, Oct 13, 2010 at 7:08 AM, Carl Eastlund c...@ccs.neu.edu wrote: In the case I have, though, I want the sequence to be empty.  The problem is that these bodies -- (let () ...), (parameterize () ...), etc. -- are used for a lot of different things.  A macro may splice in a sequence that

Re: [racket-dev] internal-definition parsing

2010-07-08 Thread Matthias Felleisen
On Jul 7, 2010, at 5:55 PM, Eli Barzilay wrote: Some examples that show how useful this is: * In the lazy language you want the implicit begin to force all expressions except for the last one. * I've redefined the implicit begin (in an ugly way) for my course language to force

Re: [racket-dev] internal-definition parsing

2010-07-08 Thread Jay McCarthy
On Thu, Jul 8, 2010 at 11:19 AM, Matthias Felleisen matth...@ccs.neu.edu wrote: On Jul 7, 2010, at 5:55 PM, Eli Barzilay wrote: Some examples that show how useful this is:  * In the lazy language you want the implicit begin to force all    expressions except for the last one.  * I've

Re: [racket-dev] internal-definition parsing

2010-07-08 Thread Matthias Felleisen
On Jul 8, 2010, at 12:09 PM, Jay McCarthy wrote: #%module-begin as the top level controlling macro is a distinguishing feature. Requires and provides can only be there and you know there's only one application. These could be an argument to the #%...-begin macro: are-you-top-level? :: (U

Re: [racket-dev] internal-definition parsing

2010-07-08 Thread Eli Barzilay
On Jul 8, Matthias Felleisen wrote: 2. I do not understand why #%body isn't enough. Couldn't #%body locally expand to the point where defs and exps are distinguished? Yes, it could -- and I guess that would be in analogy to `#%module-begin'. But I generally don't like that macros

Re: [racket-dev] internal-definition parsing

2010-07-08 Thread Eli Barzilay
On Jul 8, Matthias Felleisen wrote: On Jul 8, 2010, at 12:09 PM, Jay McCarthy wrote: #%module-begin as the top level controlling macro is a distinguishing feature. Requires and provides can only be there and you know there's only one application. These could be an argument to the

[racket-dev] internal-definition parsing

2010-07-07 Thread Matthew Flatt
Short version: I'm planning to change internal-definition expansion (anywhere that says `body ...' in the Racket documentation) to allow expressions to mingle with definitions. For example, (let () (define (f) x) (displayln f) (define x 1) (list f x)) would be allowed; the

Re: [racket-dev] internal-definition parsing

2010-07-07 Thread Eli Barzilay
On Jul 7, Matthew Flatt wrote: Short version: I'm planning to change internal-definition expansion (anywhere that says `body ...' in the Racket documentation) to allow expressions to mingle with definitions. For example, [...] Nice! On Jul 7, Matthias Felleisen wrote: 4. I am