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

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

Thread Previous | Thread Next
From:
Ashley Winters
Date:
September 5, 2005 18:00
Subject:
Re: Proposal: split ternary ?? :: into binary ?? and //
Message ID:
cda42dbb0509051800447d6678@mail.gmail.com
On 9/5/05, Damian Conway <damian@conway.org> wrote:
> Patrick suggested:
> 
>  > 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.
> 
> I think the main problem there would be the *visual* similarity
> between the two.

Indeed. The "logical" (bad pun intended) operator to match with ?? is !!

(cond) ?? (if_true) !! (if_false)

Ashley Winters

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