Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Generic Selectors? #207
This comment has been minimized.
This comment has been minimized.Show comment Hide comment
I actually started out with them type-safe but moved away from that because of the casting and compiler warning suppression I had to do throughout the code that uses them. I also wanted to match on Object rather than restrict the types that the Selector responds to. I don't think we want to restrict the possible types we can match against in the interface.
But if there's a way to make it faster, I'm of course all ears (or, in this case, eyes :).
Even now, in classes derived from Object Selector, it's necessary to do a cast for the object that matches (
I'm not saying that anything should be restricted. If someone really has to dispatch on so many objects that it's impossible to create enough selectors for it, he can still implement