[racket-dev] syntax/syntax proposal

From: Eli Barzilay (eli at barzilay.org)
Date: Thu Jun 21 11:26:18 EDT 2012

On Friday, Ryan Culpepper wrote:
> On 06/15/2012 01:12 PM, Asumu Takikawa wrote:
> > Hi all,
> >
> > Recently I was using the `stx-car` function from `syntax/stx`. At some
> > point, I had called it on a non-syntax pair and the error message came
> > from `car`, which is used inside the implementation of `stx-car`.
> >
> > I thought it would be nice to add contracts in `syntax/stx` for better
> > error messages, but it turns out that the contract library depends on it
> > and so it's impossible to do without introducing cycles.
> >
> > So I would like to propose a `syntax/syntax` library with the following:
> >    * provides `syntax/stx` functions with contracts attached
> >      (caveat: core libraries like `racket/contract` would still use
> >               `syntax/stx`)
> >    * for consistency with the rest of the language,  `stx-car` and
> >      friends would be renamed to use the `syntax-` prefix instead of
> >      `stx-`.
> -1

-1 too, because it's dealing with a dependency spaghetti situation by
adding another inter-collection line instead of removing one.

> I sometimes wonder if we should make a racket/pre-contracts
> subcollection and just stuff all of racket/contract/base's
> dependencies in there, then say everything else is allowed (maybe
> even expected) to use contracts.

I don't see how that would help -- you'll still get the same errors.
As for the above problem, `syntax/stx' is pretty simple, so maybe the
functionality can be done directly in the contracts code.  (And that
removes a dependency.)

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

Posted on the dev mailing list.