Earlier quoted context omitted.
> Awesome: prototypes Meh. I still have to write that rant, but javascript's "prototypes" are a boondoggle, they've got nothing to do with Self's prototypes[0] and don't provide anything more than classes do in nice dynamic languages (you can, in fact, do more fucking around with Python's types than with Javascript's prototypes). For all intents and purposes, Javascript's so-called prototypes are shitty single-inheri…
> don't provide anything more than classes do in nice dynamic languages How would you do in-place method mutation in something like Python or Ruby?
foo = "Hello"
def foo.to_s; "Hello world!" end
Because "def" introduces a new local variable scope, you'll have to use #define_singleton_method if you want to close over variables: foo = "Hello"
old = foo.method(:to_s)
foo.define_singleton_method(:to_s) { old.call + " world!" }