Skip to content

Instantly share code, notes, and snippets.

Last active Aug 30, 2022
What would you like to do?
Metaobject addMethodTo
package metaobjectTest
@addMethodTo("func zero -> Int", "func zero -> Int = 0;")
"""func len: String s less: Int -> Int""",
func len: String s less: Int n -> Int { return s size - n}
object AddMethodTo
func run {
assert zero == 0;
assert self len: "abcde" less: 2 == 3;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment