Created
April 15, 2012 20:54
-
-
Save juster/2394772 to your computer and use it in GitHub Desktop.
Contrived example of my problem dynamically creating methods
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
words := list("foo", "bar") | |
Foo := Object clone do( | |
words foreach(w setSlot(w, method(w println))) | |
) | |
obj := Foo clone | |
obj foo | |
obj bar | |
# Prints: | |
# bar | |
# bar | |
# | |
# What I want it to print: | |
# foo | |
# bar |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment