Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Q: Can colons control backtracking in logical expressions?
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Austin Hastings  
View profile  
 More options Apr 2 2004, 7:48 am
Newsgroups: perl.perl6.language
From: Austin_Hasti...@Yahoo.com (Austin Hastings)
Date: Fri, 2 Apr 2004 07:49:21 -0500
Local: Fri, Apr 2 2004 7:49 am
Subject: Q: Can colons control backtracking in logical expressions?

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 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, of course, from rexen.

Is this feasible?

=Austin


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.