In a message dated Wed, 4 Sep 2002, Andrew Wilson writes:

> On Wed, Sep 04, 2002 at 03:48:41PM -0500, Jonathan Scott Duff wrote:
> > On Wed, Sep 04, 2002 at 04:43:25PM -0400, [EMAIL PROTECTED] wrote:
> > > Only augment //= in subroutine declarations, //= would also work.
> > > I love the //= operator, but in the context of sub declarations it's
> > > confusing as the *only* way to default an argument.
> >
> > Oh.  You want default() to be synonymous with //= but only in
> > subroutine declarations.  That seems a tad odd. Why not make it
> > synonymous everywhere?
> >
> >     my $foo is default(23);         # same as ...
> >     my $foo //= 23;
>
> I dont see what's that meant to be achieving.  Surely It's always 23.

A more practical application would be:

  my $foo;
  # Code which might or might not set $foo...
  $foo //= 23;
  # or
  $foo is default(23);

In such a case, the C<is default> just looks plain odd to me.  Properties
are meant to be out-of-band information; miko's suggestion would have this
property setting the *value* of the variable.  Weird.  C<//=> seems
perfectly reasonable to me.

Trey

Reply via email to