Skip to content

Instantly share code, notes, and snippets.

@mvasilkov mvasilkov/_sin.sjs
Created Aug 19, 2014

Embed
What would you like to do?
Math.sin macro
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
You can’t perform that action at this time.