Skip to content

Instantly share code, notes, and snippets.

@joseoliv joseoliv/Printexpr.cyan
Last active Jun 14, 2019

Embed
What would you like to do?
printexpr
package metaobjectTest
@doc{*
Macro printexpr has the following syntax:
printexpr expr;
'printexpr' is a macro keyword and 'expr' is an expression. ';' should
end the macro call.
The macro call
var Int n = 9;
printexpr n + 1;
will print, at runtime,
'n + 1' == 10
*}
object Printexpr
func run {
var Int n = 9;
"""The following line should be, without the quotes, "'n + 1' == 10" """ println;
printexpr n + 1;
}
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.