Skip to content

Instantly share code, notes, and snippets.

@alpha123
Created December 19, 2013 18:35
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save alpha123/8044003 to your computer and use it in GitHub Desktop.
Metaprogramming in Io!
add := method(a, b, a + b)
getSlot("add") message setName("b")
getSlot("add") message next setName("-")
getSlot("add") message next argAt(0) setName("a")
# `add` now looks like
# method(a, b, b - a)
# Now I can't seem to get this part to work:
getSlot("add") argumentNames atPut(0, "b")
getSlot("add") argumentNames atPut(1, "a")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment