Last active
March 25, 2020 16:17
-
-
Save joseoliv/7aa8e2e688e072852f7c8631ebb07440 to your computer and use it in GitHub Desktop.
shout
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{* | |
Annotation 'shout' can be attached to a method. It changes | |
all strings to uppercase letters. This is a demonstration | |
metaobject, of course. | |
*} | |
object Shout | |
@shout | |
func shoutTest { | |
"shoutTest run" println; | |
let su = 'A' ++ 'B' ++ 'C'; | |
let suLower = 'a' ++ 'b' ++ 'c'; | |
assert su != suLower; | |
let b0 = "aBc" == "ABC"; | |
assert b0; | |
let b1 = "abcDEf" == "AbCdeF"; | |
assert b1; | |
let abcLower = "abc"; | |
assert su == abcLower; | |
assert abcLower == su; | |
} | |
func run { | |
shoutTest | |
} | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment