> There has to be some kind of 2-pass name lookup for > library bodies, as far as I can see.
As the Smalltalk people used to say, "You can cheat, but don't get caught." (This was for things like optimizing numbers to behave as if they weren't also objects when you do arithmetic on them.) It means, compilers can optimize as aggressively as they want, as long as they don't change the semantics away from the simple uniform meaning. In our case, I think the simple uniform meaning is the one that an interpreter without much optimization would take: Don't look inside a lambda expression at all until the procedure is invoked. I can see why a compiler would want to cheat about this, and know the bindings of symbols while compiling a not-yet-called procedure, and so might want to look ahead. But it has to not get caught, i.e., the meaning of the program has to be the same as for that simple-minded interpreter. _______________________________________________ r6rs-discuss mailing list [email protected] http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss
