Created
October 25, 2014 16:45
-
-
Save natefaubion/f4be4c8531ef45de87b4 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
macro constexpr { | |
rule { ($e:expr) } => { | |
(function() { | |
macro cexpr { | |
case { _ } => { | |
return [makeValue($e, #{ here })]; | |
} | |
} | |
return cexpr; | |
}()) | |
} | |
} | |
// Unfortunately requires an IIFE to appease the parser. Needs | |
// localexpand if we want to get rid of it. | |
// var a = 1 + constexpr(1 + 2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
update -- this works now