develooper Front page | perl.perl6.users | Postings from September 2018

DefiniteHOW and SubsetHOW don't support named parameters

Thread Next
Ralph Mellor
September 5, 2018 14:37
DefiniteHOW and SubsetHOW don't support named parameters
Message ID:
Vadim wrote:

> BTW, while researching the core sources I discovered a potential problem
with DefiniteHOW and SubsetHOW. They both define their own find_method()
which is re-delegating to their base type HOW.find_method. But they don't
support named parameters. Combined with classes with FALLBACK this may
cause some unwanted side-effects. Shall it be reported as a bug? (BTW,
quick grepping has also found RolePunning, MethodDelegation with
potentially same problem).

This is mostly beyond me.

My grasp of this stuff is weak but I wouldn't have expected SubsetHOW to
have specified any named parameters nor for there to be a reason for it to
pass on any arguments with unspecified names either. (There's a small but
non-zero performance penalty for passing on named arguments so if there's
no good reason for supporting them then core code generally doesn't.) Even
more weakly, I would have thought the same logic applies to the others
you've mentioned.

Can you provide a use case in which an example of the unwanted side-effects
you mentioned occur?


Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About