Created
June 26, 2019 22:25
-
-
Save joseoliv/5d9ad9aa1547c0c57db02601bc0c0399 to your computer and use it in GitHub Desktop.
symbolToString
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 'symbolToString' takes a single parameter and produces | |
a string whose contents is the parameter. Then the annotation is | |
an expression of type String. | |
This annotation is used mainly in generic prototypes to convert | |
a generic parameter to a string. | |
*} | |
object SymbolToString | |
func run { | |
var String aa = @symbolToString(SymbolToString); | |
assert aa == "SymbolToString"; | |
aa = @symbolToString("Int"); | |
assert aa == "Int"; | |
aa = @symbolToString(T); | |
assert aa == "T"; | |
} | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment