Skip to content

Instantly share code, notes, and snippets.

@joseoliv joseoliv/Eval.cyan
Created Jun 13, 2019

Embed
What would you like to do?
eval
package metaobjectTest
@doc{*
Annotation 'eval' is an expression that returns the value
returned by the attached DLS that is in interpreted Cyan
*}
object Eval
func run {
var Int sum = @eval("cyan.lang", "Int"){*
var Int count = 0;
for n in 1..10 {
count = count + n
}
return count;
*};
assert sum == 55;
}
end
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.