[plt-scheme] determine free variables

From: Jay McCarthy (jay.mccarthy at gmail.com)
Date: Sat Mar 29 14:12:09 EDT 2008

On Sat, Mar 29, 2008 at 11:54 AM, Sam TH <samth at ccs.neu.edu> wrote:
>  It seems that #f should only be returned if the binding refers to a
>  variable bound at the top-level (the real top-level, no in a module).
>  Are you trying to handle this case?  That seems more analogous to the
>  module-bound variable case, which are not included in the results in
>  either implementation.  Can you describe the code that goes wrong
>  without that?

I think, but I'm not sure, that these ids are once introduced by
earlier stages of the compiler. I use free-vars after I convert to ANF
form. ANF introduces names for many intermediate values and these
identifiers have binding #f. (I get those identifiers from
generate-temporaries.)

I just looked up the docs for identifier-binding and see what you say.
I'm not sure what the right answer is. These identifiers are *not*
bound at the top-level. Perhaps because I don't fully expand again
after introducing them their binding status is not marked when
free-vars walks over them?

Jay

-- 
Jay McCarthy <jay.mccarthy at gmail.com>
http://jay.teammccarthy.org


Posted on the users mailing list.