Created
August 19, 2014 09:01
-
-
Save mvasilkov/1f51620ad126604781ff to your computer and use it in GitHub Desktop.
Math.sin macro
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 _sin { | |
case { _($x:lit) } => | |
{ | |
var res = Math.sin(unwrapSyntax(#{ $x })) | |
return [makeValue(res, #{ $x })] | |
} | |
case { _($x) } => | |
{ | |
return #{ Math.sin($x) } | |
} | |
} | |
var a = _sin(0.5) | |
/////////// | |
var x = 0.5 | |
var b = _sin(x) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment