There's more than one way to do things | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
So how do you chain your implementations of hgrep and hmap?
hgrep {...} hmap {...} %h ??? Your trying to convince me that breaking the established interface is OK because there "is no use case". (or to be precise that I have to show a use case while you don't try to prove that there is none) I'm saying it's safer to respect symmetry because nobody can anticipate all use cases, not even you. I don't say your code doesn't make sense from a performance analysis, BUT then
A good design avoids traps and misunderstandings w/o overloading the language with edge cases!
Cheers Rolf UPDATE: Since I thought that uneven lists should be disallowed anyway, I think it's not too dirty to consider a single argument to be a hashref. Like this both hgrep \%h and hgrep %h would work and could be chained. In reply to Re^12: Is there any difference between prototype % and @ ?
by LanX
|
|