[racket-dev] syntax/syntax proposal

From: Asumu Takikawa (asumu at ccs.neu.edu)
Date: Fri Jun 15 15:12:05 EDT 2012

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-`.
  * the name of the library is also consistent with the rest of the
    language.

This could replace `syntax/stx` for most users and provide both better
error messages and identifiers that follow standard Racket naming
convention.

I've attached a patch that implements this. Any comments?

Cheers,
Asumu

Posted on the dev mailing list.