[plt-scheme] determine free variables

From: Jay McCarthy (jay.mccarthy at gmail.com)
Date: Sat Mar 29 13:47:04 EDT 2008

Thanks for the update.

The following difference remains:

Your id case is:

     (identifier? #'id)
     (if (eq? 'lexical (identifier-binding #'id))
         (list #'id)

While mine is:

(let ([i-bdg (identifier-binding #'id)])
            [(eqv? 'lexical i-bdg)
             (list #'id)]
            [(not i-bdg)
             (list #'id)]

I don't think eq/eqv matters. But when the identifier-binding is #f
does. I find many errors in transformed code if these are not
considered free. I don't really understand why, but I believe I came
to this particular test by looking at what the macro debugger said
some obviously free vars identifier-binding was.

I presume that your implementation will be much more efficient than
mine, btw, given its use of identifier mappings.


On Sat, Mar 29, 2008 at 10:41 AM, Sam TH <samth at ccs.neu.edu> wrote:
> On Mon, Mar 24, 2008 at 9:18 PM, Jay McCarthy <jay.mccarthy at gmail.com> wrote:
>  > That's interesting.
>  >
>  >  A note though: that implementation doesn't handle
>  >  letrec-syntaxes+values which isn't in true fully expanded code, but
>  >  will show up in the result of local-expand with an empty stop list.
>  >  (I've talked to mflatt about this and he said there isn't a way to get
>  >  true fully expanded code.)
>  This is now fixed.  If you could take a look at it and see if there's
>  anything else that needs to change for you to be able to use it in the
>  webserver, that would be great.
>  Thanks,
>  --
> sam th
>  samth at ccs.neu.edu

Jay McCarthy <jay.mccarthy at gmail.com>

Posted on the users mailing list.