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

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

Thread Previous | Thread Next
From:
Patrick R. Michaud
Date:
September 6, 2005 00:04
Subject:
Re: Proposal: split ternary ?? :: into binary ?? and //
Message ID:
20050905215102.GB17667@host.pmichaud.com
On Tue, Sep 06, 2005 at 07:26:37AM +1000, Damian Conway wrote:
> Thomas Sandlass wrote:
> 
> >I'm still contemplating how to get rid of the :: in the
> >ternary 
> >
> >Comments?
> I believe that the single most important feature of the ternary operator is 
> that it is ternary. That is, unlike an if-else sequence, it's impossible to 
> leave out the "else" in a ternary operation. Splitting the ternary destroys 
> that vital characteristic, which would be a very bad outcome.

At OSCON I was also thinking that it'd be really nice to get rid of 
the :: in the ternary and it occurred to me that perhaps we could use
something like '?:' as the 'else' token instead:

   (cond) ??  (if_true) ?: (if_false)

However, I'll freely admit that I hadn't investigated much further
to see if this might cause other syntax ambiguities.

Pm

Thread Previous | Thread Next


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