User loginNavigation |
Understanding hygieneI have hobby-researched the topic of hygiene for quite some time, and it's become a no-brainer for me that hygiene is good. The reason is that macros can be viewed as "programmable inline functions", and when considering inlining, it's quite clear that renaming of the variables introduced by an inlined piece of code, as well as making sure that variables used by that piece of code still point to their original bindings when the code is inlined, is necessary. So it seems that there are two fundamental issues, which are sometimes referred to as "hygiene" vs "referential transparency": introduction of names vs use of names. When a macro introduces a name into its output, we want to automatically rename (or otherwise mark) that name, so that it's actually invisible at the point of the macro call. (Except when we want to introduce a visible name, which requires the use of a hygiene breaker, a function that can inject a name into a particular context.) When a macro (expansion) uses a name, we want to make sure that that name cannot be shadowed by the surrounding context of the macro call. Somehow, a name used by a macro expansion needs to remember its original binding, namely the binding that was in effect where the macro was defined (as opposed to called). My questions:
Thanks! By Manuel J. Simoni at 2010-04-30 14:07 | LtU Forum | previous forum topic | next forum topic | other blogs | 3913 reads
|
Browse archives
Active forum topics |
Recent comments
22 weeks 6 days ago
22 weeks 6 days ago
22 weeks 6 days ago
45 weeks 19 hours ago
49 weeks 2 days ago
50 weeks 6 days ago
50 weeks 6 days ago
1 year 1 week ago
1 year 6 weeks ago
1 year 6 weeks ago