On Thu, 2002-04-11 at 09:36, Jonathan Scott Duff wrote:
> On Wed, Apr 10, 2002 at 10:45:55PM -0600, Luke Palmer wrote:
> > Indeed, and with the //= thing, you can let parameters in the middle 
> > default.
> 
> Except that I haven't heard anyone say that given
> 
>       sub foo ($a//=1, $b//=2, $c//=3) {...}
>       foo(5,,6);                              # that this would work.
> 
> Will it?

1, in the above, you could use

        foo(5,undef,6);

2, the above is insanely ugly, so I'm now on the "= bandwagon" ;-)

Sure, //= makes sense and should be preserved, but why not allow = too,
since it has an equally obvious meaning, which is far more commonly
desired?

Also, another though:

        sub foo($a = 1, $b, $c) { ... }

In C++ at least, I think this is an error. However, it seems to me that
in Perl it could be interpreted to be equivalent to:

        sub foo($a = 1, $b = undef, $c = undef) { ... }

Which, again, allows us to clean up the common case.


Reply via email to