in reply to Re^2: RFC: New style for argument check in subs
in thread RFC: New style for argument check in subs
You have a special understanding of optional.
What a beautifully crafted put-down :)
My reasoning is: if its allowed, even if it is optional -- in fact especially if it is optional -- it should have a default value. Even if that default value is undef.
One of the benefits of that, is that it deals with the "actual value is undef" problem. If the explicitly passed value is undef, and you override it to its default which is undef, then ...
I do remember some discussion around the possibility of using undef to override a default value, but I decided that such usage was rare and obscure enough that if teh occasion arose it was necessary, I'd had code a solution for it above or below the standard mechanism as appropriate.
I don't mind hand coding a solution for the 1 in 1000 case, if that means the other 999 cases operate in an efficient manner.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: RFC: New style for argument check in subs
by LanX (Saint) on Sep 05, 2012 at 13:45 UTC |