Created
June 24, 2019 03:13
-
-
Save joseoliv/55e1a75ab83839f9aec13c10d3d75338 to your computer and use it in GitHub Desktop.
parametersToString
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 'parametersToString' takes any number of parameters | |
and produces a string with all of them. This is a demonstration | |
metaobject. | |
*} | |
open | |
object ParametersToString | |
func run { | |
var allParametersToString = @parametersToString( | |
0, | |
'a', | |
"Newton", | |
Newton, // identifier, counts as string | |
[ 0, 1, 2 ], | |
[ "zero" -> 0, "one" -> 1 ], | |
[. "Newton", 1643 .], | |
[. Newton, 1643 .], | |
// mixed literals | |
[ [. Newton, 1643 .], [. Turing, 1912 .] ], | |
[ 1 -> [ [. "one", "english".], [. "um", "portugues" .] ], | |
2 -> [ [. "two", "english" .], [. "dois", "portugues" .] ] ] | |
){* | |
Text of 'parameters' | |
more text | |
*}; | |
printexpr allParametersToString; | |
} | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment