develooper Front page | perl.perl6.language | Postings from November 2003

RE: Control flow variables

Thread Previous | Thread Next
From:
Gordon Henriksen
Date:
November 19, 2003 05:47
Subject:
RE: Control flow variables
Message ID:
018f01c3ae2b$c178ebe0$cc54e8c7@domain.ma.iclub.com
Austin Hastings wrote:

> I'm way not sure about how the vector context result of iteration
structures
> will work. Specifically, what happens when a loop forks a thread, or
passes
> to a parallelized coroutine? There may not actually BE a result. (Of
course,
> in a right-thinking system this will be noted, and replaced by a
placeholder
> object that will "wait" for the result if evaluated.)

Whuh? Tangential at best... The result would be the same as in a
non-vectorized version, just repeated automatically for you.

    my @b = for @a -> $_ {
        ...
    }

Should be broadly equivalent to:

    my @b = map { ... } @a;

    - OR -

    # (Apologies for the perl5-isms.)
    for @a -> $_ {
        push @b: do { ... };
    }

If the non-vectorized version has hidden a thread join operation in a
tied or otherwise magical result value, then so too would the vectorized
version. But that's a completely orthogonal feature; unrelated and not
in conflict.

--
 
Gordon Henriksen
IT Manager
ICLUBcentral Inc.
gordon@iclub.com



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