3 ms·
There's not really anything equivalent in the Go world right now so I chose to just adopt the Ruby/Python term :) It kind fits in with what Wikipedia describes
by bouk 12y ago
There's not really anything equivalent in the Go world right now so I chose to just adopt the Ruby/Python term :)
It kind fits in with what Wikipedia describes as monkey patching http://en.wikipedia.org/wiki/Monkey_patch http://en.wikipedia.org/wiki/Monkey_patch
- kylequest 12y agoExcept the wiki page about monkey patching talks about it in the context of dynamic languages :-) It doesn't talk about C, C++ or other compiled languages. Definitely nice work!
- simscitizen 12y agoDynamic and compiled are not mutually exclusive. Objective-C is both a dynamic and compiled (to machine code) language that supports monkey patching. It supports extending classes with new methods and overriding existing methods in existing classes through its category feature. This does have an unfortunate side effect though. Because Objective-C is a) compiled directly to machine code b) has no way of marking methods final and c) supports monkey patching, essentially no methods can be inlined by the compiler.
- kylequest 12y agoOf course, dynamic and compiled are not mutually exclusive. Go is not like Objective-C though and it doesn't support "Categories" or "extension methods" :)