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

Re: Control flow variables

Thread Previous | Thread Next
From:
Luke Palmer
Date:
November 19, 2003 08:30
Subject:
Re: Control flow variables
Message ID:
20031119163015.GB14854@babylonia.flatirons.org
Piers Cawley writes:
> All of which means you can wrap it up in a macro and prove Simon's
> point about what's syntax and what's CP6AN:
> 
>    macro unless_all( Block &test is parsed /<perl.expression>/,
>                      Block &consequence, *@ary ) 
>      { my $guard = Object.new;
>        for *@ary, $guard 
>          -> { when $guard { &consequence() ; last }
>               when &test { last } } }
> 
> But I've probably got the signature slightly wrong. 

I think the only thing that's wrong with your signature is that you said
"macro" instead of "sub".  Well, and &test has to be finessed into an
executable block somehow, but we're not supposed to know how yet.

> Higher Order Functions/Methods/Macros are great aren't they? 

What a modern thinker!  Use a *function* to do a common task?  *What*
are you talking about!?  :-)

Luke

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