in reply to Re: Re: Re: Exegesis 6 - Named binding
in thread Exegesis 6 - Named binding
I would assume that writing *%data in any context is equivalent to writing%data = << why dunno who them where there which this >>;
So assuming we can use this as an lvalue, an assignment with a list of pairs to this would be the same as taking each pair and assigning it to the value with the specific key. So *%data = *%values should be compiled as(why => "dunno", who => "them", where => "there", which => "this")
Let me take another example and go back to part(). We could write:multi sub infix:=(List of Pair @assign is rw, List of Pair @values) re +turns List of Pair { my %assign := *@assign; for @values { %assign{.key} = .value; } return *%assign; }
So the question here is, is $fish eq "hest" after this, or undef?my $fish = "hest"; ($sheep, $goats, $fish) := part Animal::Cat, @animals;
Would that give the same result?my $hest = "hest"; %result := ($sheep, $goats, fish => $hest) := part Animal::Cat, @anima +ls;
($sheep, $goats, $fish => "hest") := part Animal::Cat, @animals;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Re: Re: Re: Exegesis 6 - Named binding
by broquaint (Abbot) on Jul 31, 2003 at 14:29 UTC |