Skip to content

Instantly share code, notes, and snippets.

@wwqrd
Last active December 16, 2015 18:21
Show Gist options
  • Save wwqrd/5477379 to your computer and use it in GitHub Desktop.
Save wwqrd/5477379 to your computer and use it in GitHub Desktop.
1984 meets Io lang
oldSpeakAddition := Number getSlot("+")
Number + := method( a,
if( a == 2 and self == 2, 5, self oldSpeakAddition( a ) )
)
writeln( 1 + 1 ) # prints "2"
writeln( 1 + 2 ) # prints "3"
writeln( 2 + 2 ) # prints "5"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment