develooper Front page | perl.perl6.language | Postings from May 2001

Re: Damian Conway's Exegesis 2

Thread Next
From:
John Siracusa
Date:
May 15, 2001 16:42
Subject:
Re: Damian Conway's Exegesis 2
Message ID:
B7273724.174B7%siracusa@mindspring.com
Okay, this part has me confused.  Here we build up a node hash:

    my %node;
    %node{LEFT}   = undef;
    %node{RIGHT}  = undef;
    %node{VALUE}  = $val is Found(0);
    $tree = %node;

What has the Found property here?  I look at that and I think the value
associated with %node hash's VALUE key has the Found property.

But later, this property is set and retrieved from, seemingly, the hash
itself, with no reference to the VALUE key:

    sub search (HASH $tree is rw, *@_)
    {
      ...
      return $tree is Found($tree.Found+1);
    }

Isn't the Found property on $tree{VALUE}?  Or is this a totally separate
Found property on the entire hash?  And if so, why is the other Found
property on the value associated with the VALUE key set at all, and then
never accessed again?

-John


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