Skip to content

Instantly share code, notes, and snippets.

@joseoliv
Created June 24, 2019 03:13
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/55e1a75ab83839f9aec13c10d3d75338 to your computer and use it in GitHub Desktop.
Save joseoliv/55e1a75ab83839f9aec13c10d3d75338 to your computer and use it in GitHub Desktop.
parametersToString
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