On 6/19/07, Larry Wall <[EMAIL PROTECTED]> wrote:
On Tue, Jun 19, 2007 at 11:50:35AM -0400, Charles Bailey wrote:
: Yep.  For that matter, if I had to pick one change in this area that'd
: have maximum impact, I'd say a good assign-if-uninitialized idiom
: would be way ahead of an if-then-else idiom.

Depending on how you mean "uninitialized", that would be either:

    $x //= 42;          # init if undefined

or

    state $x = 42;      # init first time through

Both of which are getting borrowed back into Perl 5, as it happens.

This is a Good Thing, on both counts.  (I was thinking primarily of the former.)

My intent was to say that I'm glad this was addressed in the design of
P6, since it is, in my experience, a much more common version of the
conditional assignment problem than the ternary operator.   Yet
another example of P6 doing things well.

Rereading my original comment, I see this is less than clear.  My
apologies for the confusion.

--
Regards,
Charles Bailey
Lists: bailey _dot_ charles _at_ gmail _dot_ com
Other: bailey _at_ newman _dot_ upenn _dot_ edu

Reply via email to