Last active
August 30, 2022 08:17
Star
You must be signed in to star a gist
Metaobject addMethodTo
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 | |
@addMethodTo("func zero -> Int", "func zero -> Int = 0;") | |
@addMethodTo( | |
"""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; | |
} | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment