Skip to content

Instantly share code, notes, and snippets.

@joseoliv
Created June 13, 2019 13:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joseoliv/e32e48c97ecb566f45587b4271145623 to your computer and use it in GitHub Desktop.
Save joseoliv/e32e48c97ecb566f45587b4271145623 to your computer and use it in GitHub Desktop.
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