develooper Front page | perl.perl6.language | Postings from September 2005

Re: Proposal: split ternary ?? :: into binary ?? and //

Thread Previous
From:
Damian Conway
Date:
September 5, 2005 23:07
Subject:
Re: Proposal: split ternary ?? :: into binary ?? and //
Message ID:
431D321B.7030607@conway.org
Luke wrote:

> Not that being explicit is always a bad thing:
> 
>     $val = some_cond()
>               ?? ($arg1 // $arg1_default)
>               // ($arg2 // $arg2_default)

No. What's a bad thing is creating new linguistic traps for when people 
inevitably forget to be explicit.


> And I question your notion of "highly useful" in this case.

Huh??? Both // and the ternary are unquestionably highly useful constructs. My 
point was that making them not work together is a Very Bad Idea.


> I guess the thing that I really think is nice is getting :: out of
> that role and into the type-only domain.

Yes, I'd certainly like that too. But not at the cost of turning // into a 
bear-pit for the unsuspecting.

Damian

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About