in reply to Re: Re: Exegesis 6 - Named binding
in thread Exegesis 6 - Named binding
Either it is the same as %details{who} = "me", %details{why} = $because, which would make sence because of the unary * operator or it would be the same as %details = ();%details{who} = "me", %details{why} = $becauseThe reason I suspect it to be behave like the latter is because the flattening behaviour of the * in this context. If we broke it down it might look something like this
That of course assumes the kv method is lvaluable, but basically it looks like it's assigning all of %data to the RHS. Whereas with named binding it will just be the keys who and why which are bound, otherwise we assume that named binding behaviour is also used in straight assignments, which isn't the case. Again this is all speculation, but I'm hoping it's not too far off, or at least raising some interesting issues. Perhaps in this particular instance the splat is a no-op, or maybe it's a slurp and %data isn't run-over (but that would in turn make the assignment look like a right-to-left pipe ...).%data = << why dunno who them where there which this >>; *%data = ( who => 'me', why => 'because' ); ## which if we expand the splat expands to (I think) %data.kv = ( who => 'me', why => 'because' );
HTH
_________
broquaint
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Re: Re: Exegesis 6 - Named binding
by Cine (Friar) on Jul 31, 2003 at 14:05 UTC | |
by broquaint (Abbot) on Jul 31, 2003 at 14:29 UTC |
In Section
Seekers of Perl Wisdom