James Laver james.laver at
Thu May 2 22:44:10 BST 2013

On 2 May 2013, at 18:50, "Th. J. van Hoesel" <th.j.v.hoesel at> wrote:

> Back to your code, line 198:
>  if (@_ >= 2)
> Why not check for 
>  if (@_ == 2)
> ?
> it should have only two arguments to construct a fraction from calling Number::Fraction->new(1, 2);
> Why would you allow it to pass other arguments?

It looks like a combination of defensive programming and laziness. If you check for length of two, you have to handle both the case of too few args and too many args in addition to the case of two args. This is lazier and will it really harm it people pass more than 2 to silently ignore the extras?


More information about the mailing list