> -Original Message-
> From: Larry Wall [mailto:[EMAIL PROTECTED]
>
> On Fri, Apr 02, 2004 at 03:05:30PM +0100, Simon Cozens wrote:
> : [EMAIL PROTECTED] (Austin Hastings) writes:
> : > > if (specific() ?? detail1() && detail2() :: general()) {...}
> : >
> : > For some value of "correc
On Fri, 2004-04-02 at 10:01, Larry Wall wrote:
> Even an almost purely RPN language
> like Japanese likes to use honorifics and/or a bunch of particles to
> mark the ends of its sentences, yo?
Hai, and it's not just there to help in error reporting. Imagine the
case:
if if if if if ... {.
On Fri, Apr 02, 2004 at 03:05:30PM +0100, Simon Cozens wrote:
: [EMAIL PROTECTED] (Austin Hastings) writes:
: > > if (specific() ?? detail1() && detail2() :: general()) {...}
: >
: > For some value of "correct" I suppose. Using ??:: within an if/else context
: > makes my skin crawl, stylistic
[EMAIL PROTECTED] (Austin Hastings) writes:
> > if (specific() ?? detail1() && detail2() :: general()) {...}
>
> For some value of "correct" I suppose. Using ??:: within an if/else context
> makes my skin crawl, stylistically. :-(
Ah, then use if!
if (if(specific()) { detail() } else { ge
> -Original Message-
> From: Damian Conway [mailto:[EMAIL PROTECTED]
>
> > Since paren's aren't required with keywords, can they still serve as rex
> > delimiters?
>
> No. For other syntactic reasons parens aren't allowed as rule
> delimiters at all. And only /.../ delimit "raw" matches. Ev
> All you really need is:
>
> if ( specific_condition() ? detail() : general_condition() )
Oops! That's the Perl 5 version. In Perl 6, of course, it's:
if ( specific_condition() ?? detail() :: general_condition() )
Which means you *do* get to use the :: after all!
(Just not where you mi
Austin Hastings wrote:
Both look horrible, of course. I'd like to rewrite them as
if (specific_condition() :: && detail()) || general_condition()
{
act();
}
so that if specific_condition() succeeded, it would cause the entire
expression to fail if detail() failed.
The use of :: comes, o
Consider this code:
if (specific_condition())
{
if (detail())
{
act();
}
}
elsif (general_condition())
{
act();
}
Logically, this turns into:
if ((my $sc = specific_condition()) && detail())
|| (!$sc && general_condition())
{
act();
}
Both look