Skip to content

Instantly share code, notes, and snippets.

@juster
Created April 15, 2012 20:54
Show Gist options
  • Save juster/2394772 to your computer and use it in GitHub Desktop.
Save juster/2394772 to your computer and use it in GitHub Desktop.
Contrived example of my problem dynamically creating methods
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