Last active
June 14, 2019 22:41
-
-
Save joseoliv/7bd41c58f01cb01fc1544bf566570ecb to your computer and use it in GitHub Desktop.
printexpr
This file contains 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
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