Even more clarification on Type piracy

@Nosferican By “type 1” and “type 2” are you referring to the two categories I mentioned? If so, as I said, “type 1” (= At least one of the argument is dispatched on type you defined) was meant to be an example of non-type piracy but I then realized that the definition was not good enough. But “type 2” (= None of the type are defined within your package) is still type piracy and I don’t think there is ambiguity here. I should have mentioned a clear non-type piracy method extension: all of the arguments are dispatched on type you defined.

I didn’t try to pirate the type piracy concept. I explicitly introduced those two categories as “the ways you extend functions”, not two types of type piracy. There are good, expected and encouraged ways for extending functions.

2 Likes