I'm using Pharo 5.0. In a couple of cases, I have found a limit or possibly a bug in an existing Pharo class (e.g., something in DBXTalk/Garage, or Regex-Core). I would like to be able to modify a selector or set of selectors that exist(s) in a class outside of my own project and make that part of my package.
I have found several instructions on how to create a new selector in an outside class and move that into my package (e.g., as shown in this tutorial). That's very cool. But in some cases I actually want to modify an existing selector in the outside class and have my copy of that selector override the one in the outside class when I use it. I don't wish to modify the existing 3rd party or Pharo pre-supplied package.
In GNU Smalltalk, I can do that just as a normal part of doing a class extend. For example:
Kernel.MatchingRegexResults extend [
at: anIndex [
"My updated version of the 'official' Kernel.MatchingRegexResults#at: selector"
"This is part of my package so overrides the 'official' version"
...
]
foo [
"My new foo selector"
]
]
How can I do this in Pharo 5.0? I've done quite a bit of searching but couldn't find a means of doing it. The words "extend" or "override" do not appear in the Pharo by Example and Deep Into Pharo books.