Created
September 27, 2013 21:47
-
-
Save disnet/6735679 to your computer and use it in GitHub Desktop.
hygiene
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var random = function(seed) { /* ... */ } | |
let m = macro { | |
rule {()} => { | |
var n = random(42); // ... | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In fact, instead of renaming macro-declared variables to prevent overlap, you could just wrap (while expanding) the body of the macro code in a stand-alone
{ .. }
block and changevar
s tolet
s, and that would create hygiene (aka, prevent any inner-to-outer leakage) in the same way as renaming, but with way less work.