develooper Front page | perl.perl6.language | Postings from July 2001

Re: if3 then else otherwise ...

Thread Previous | Thread Next
From:
Edward Peschko
Date:
July 30, 2001 20:28
Subject:
Re: if3 then else otherwise ...
Message ID:
20010730202802.A19343@excitehome.net
> Ed,
>   Why should it die a horrible death?  It seems like something which could be
> pretty easily implemented:
> 
> sub if3 ($&&&) {
>   return &{$_[1]} unless $_[0];
>   return &{$_[2]} if $_[0] < 0;
>   return &{$_[3]};
> }
> 
> gives the functionality.  A little more research (and perhaps a quick
> coversation with Damian Conway) shoud result in the desired syntax.

ok, never mind. I got the impression that this was a built-in function, ie:
if3 goes along with <=> the same that ()? :  goes along with if() else.

I have no problem if it follows from prototypes. Maybe we could implement '??'
along the same lines. ;-)

Ed

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