I confess, I don't get it. To me, it appears to iterate over the input,
printing unique values except that two values ($start, $finish) are
considered to have already been encountered.

If that's all, then okay. But does it somehow skip all entries
before/after the delimiter?

Also, in a related vein, how do flexen and rexen interact?

That is, what happens if I try to match a flexpr? Do I get flexprs in
all the match variables, or what?

=Austin


--- John Siracusa <[EMAIL PROTECTED]> wrote:
> On 10/29/02 3:13 PM, Damian Conway wrote:
> > I suspect it will be quite unusual to see nested superpositions
> > in code. Most folks are going to be using them for simple but
> > very common checks like:
> > 
> > [...]
> >
> > my $seen = $start | $finish;
> > for <> -> $next {
> > print $next unless $next == $seen;
> > $seen |= $next;
> > }
> 
> I just spent 2 minutes staring at that last example until I finally
> understood it.  While I agree that there are many common uses for
> this
> stuff, not all common uses are "simple", IMO.
> 
> I think my hang-up mostly had to do with all the existing "knowledge"
> I have
> about how "|" and "|=", and even "==" are "supposed" to work.  Had
> the
> example used the English versions of the operators, I would have
> gotten it
> instantly:
> 
> my $seen = any($start, $finish);
> 
> for <> -> $next
> {
>   print $next  unless $next == $seen;
>   $seen = any($seen, $next);
> }
> 
> (Okay, maybe I would have gotten stuck for a moment on the "$next ==
> $seen"
> part, but that's about it :)
> 
> Anyway, I think this is just a long-winded way of expressing my
> support for
> an article explaining set operators (or "cat-bunny slippers" or
> whatever :)
> and all their wonderful uses.  And I also think the English versions
> of the
> operators are much easier to understand, at least initially, if only
> due to
> the  historical baggage of |, &, and friends.
> 
> -John
> 


__________________________________________________
Do you Yahoo!?
HotJobs - Search new jobs daily now
http://hotjobs.yahoo.com/

Reply via email to