[racket] Check syntax and disappearing bindings

From: Vincent St-Amour (stamourv at ccs.neu.edu)
Date: Fri Aug 12 17:18:56 EDT 2011

I have a macro that restructures `let' binding lists, and I would like
to have it play nice with Check Syntax.

Here's an example:

(let ([x 1.2+3.4i])
  body ...)

is expanded to:

(let ([x-real 1.2]
      [x-imag 3.4])
  body ...)

with references to `x' replaced by references to `x-real' and `x-imag'
appropriately.

The macro works fine, but causes Check Syntax to not draw arrows
between uses of `x' in the body and the binding occurrence of
`x'. Which makes sense, given that none of these are present in the
fully expanded code.

It seems that the 'disappeared-binding syntax property may be what I
want, but I haven't figured out how to use it, and the documentation
does not say much about it.

I tried adding the 'disappeared-binding property with a list
containing the syntax object corresponding to the binding occurrence
of `x' as value, and 'disappeared-use properties with the syntax
objects corresponding to the references to `x' that were removed.

I tried adding these syntax properties in various places in the
program, but couldn't get Check Syntax to show the arrows.

Is 'disappeared-binding what I want? If so, where do I need to put the
property to get Check Syntax to recognize it?

Vincent


Posted on the users mailing list.