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 Explanation re: chaining postconditionals?
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
 
David Storrs  
View profile  
 More options May 1 2003, 6:48 pm
Newsgroups: perl.perl6.language
From: dsto...@dstorrs.com (David Storrs)
Date: Thu, 1 May 2003 14:52:21 -0700
Local: Thurs, May 1 2003 5:52 pm
Subject: Re: Explanation re: chaining postconditionals?

On Thu, May 01, 2003 at 04:07:41PM -0400, Uri Guttman wrote:

[MikeL asks: why no post-X chaining?]

> the biggest problem IIRC was nested loops. how do you bind $_ two or
> more times in one expression.

>    blah($_) for @array1 for @array2 ;

> what is $_ bound to?

Same thing it would be if I did this:

    for (@array2) {
        for (@array1) {
            blah($_);
        }
    }

> if/unless are easily done with || and && so they aren't even needed.

Not to reactivate this whole thing, but that argument doesn't hold a
lot of water.  I<unless> is not really needed--you can get the same
thing by saying C<if (not $foo)>.  Likewise, C<and> and C<or> are not
needed--you can get the same effect with && and || and a bunch of
parens.  Come to think of it, you don't really B<need> to be able to
return multiple values, right?  You could always just pass a reference
to an array in as an extra parameter, then stuff that array before
returning....

Basically, why draw the line here?

>    expr && return for @array ;

Seems fine.  Exit the current function unless expr evaluates to false
once for each element of @array...presumably, you are testing
something in @array, but not necessarily.  

> finally, larry said they aren't going to be supported and that is a good
> reason all by itself.

Yep, that IS a good enough reason.  Like Paul, though, I _would_ like
to understand Larry's thinking.  This call seems arbitrary, which is
unusual for Larry.  I'd even be happy with "My experience tells me
that this will cause a lot of problems down the road, but I can't put
my finger on why."

--Dks


 
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.