On Wed, 27 Jun 2007, Anton van Straaten wrote: > Can you give me an example of what you're thinking of in the case of > libraries?
Local imports: Should shadowing take place in either of the two imports below? With e.g. Oleg's solution, shadowing would take place due to at least one, and maybe both, let-bindings. (let ((r6rs 1) (base 2)) (local-import (r6rs)) (local-import (r6rs base)) ....) Local libraries: Assuming they have compound names also, presumably this could be made to shadow, but it would require an extension to the expander so that it can bind not only identifiers but compound objects: (let () (library (r6rs base) ------) (local-import (r6rs base)) ----) Macro-generated libraries: (let () (let-syntax ((emit-library (syntax-rules () ((_) (library (r6rs base) ----))))) (emit library) (local-import (r6rs base)) ----) Here, in the case of ordinary identifiers, hygiene would cause the import statement to import the /toplevel/ library, not the one generated by the macro. However, for compound names, this is hard to do. I'm not even sure that there is a good solution. For example r6rs and base might have different marks/colours already. Something could perhaps be done, but considering the way at least my expander works, I think it would be ugly. The only solution I can imagine would be for local library names to be identifiers, so the syntax of local libraries and toplevel libraries would have to be different. That would be okay, I guess, but IMO unSchemely, considering the single-namespace history of the language. Consider (let () (library r6rs --------) (let ((r6rs 1)) (local-import (r6rs) ;; not shadowed because toplevel name is ;; list of symbols? r6rs)) ;; shadowed because identifier ----)) Cheers Andre _______________________________________________ r6rs-discuss mailing list r6rs-discuss@lists.r6rs.org http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss