[racket-dev] `cond' / `when' / `unless' / etc bodies

From: Eli Barzilay (eli at barzilay.org)
Date: Tue Oct 12 10:43:03 EDT 2010

An hour ago, Matthew Flatt wrote:
> At Mon, 11 Oct 2010 20:38:58 -0400, Eli Barzilay wrote:
> > > At Mon, 11 Oct 2010 19:15:09 -0400, Eli Barzilay wrote:
> > > > I'd love to see an implicit `#%begin', which could have the
> > > > above apply in more places automatically.  (It was one of the
> > > > feature requests I asked for in the summer meeting.)
> > > 
> > > Recall that no one solved the technical problem with where to
> > > pull the lexical context for the implicit `#%begin' or `#%body':
> > > 
> > >   http://lists.racket-lang.org/dev/archive/2010-July/003624.html
> > 
> > I remember being confused with how that problem would look like,
> > but I don't think that I've seen an example where this would be
> > problematic.  (I think that we talked about it, but I can't
> > remember any concrete details...)
> Can you say more about how the `squawk' example in the referenced
> post doesn't illustrate the problem?

It doesn't specify any clear problem -- either that or I'm missing
something obvious...  AFAICT, the problem that is described there is
similar to:

 (define-syntax-rule (squawk body ...)
     (printf "squick ~a!" "squawk")
     (let () body ...)))

having the implicit `#%app' come from this macro's module rather than
the use site, for example, if it's defined in a module that has
implicitlty curried applications then the `printf' call becomes
curried.  So if this is the problem, it doesn't seem problematic,
given that `#%app' does the same now, and that it's easy to get used
to that.

But it looks to me like there is something that I'm missing, since
that `#%app' feature doesn't require going to identifier macros...

          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!

Posted on the dev mailing list.