Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
package metaobjectTest
Annotation 'createPrototype' creates one or two prototypes in the
current package given their names. It can be used
@createPrototype(prototypeName1, codeForPrototypeName1)
@createPrototype(prototypeName1, codeForPrototypeName1,
prototypeName2, codeForPrototypeName2)
prototypeName1 is created in phase dpa, and
prototypeName2 is created in phase afti.
object CreatePrototype
"package metaobjectTest\nobject Dragon\n func get -> Int { return 0 }\n\nend",
"package metaobjectTest\nobject Elf\n func get -> String { return \"Elf !\" }\n\nend"
func run {
let Dragon dragon = Dragon new;
assert dragon get == 0;
assert Elf() get == "Elf !";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment