Skip to content

Instantly share code, notes, and snippets.

@joseoliv
Created June 26, 2019 22:25
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/5d9ad9aa1547c0c57db02601bc0c0399 to your computer and use it in GitHub Desktop.
Save joseoliv/5d9ad9aa1547c0c57db02601bc0c0399 to your computer and use it in GitHub Desktop.
symbolToString
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