develooper Front page | perl.perl5.porters | Postings from December 2019

Re: Named Parameters

Dave Mitchell
December 16, 2019 11:43
Re: Named Parameters
Message ID:
On Fri, Nov 29, 2019 at 04:44:24PM +0000, wrote:
> Dave Mitchell <> wrote:
> :Duplicate named arguments are allowed, the last value being used. This
> :allows the useful idiom of foo(%defaults, %options) to work.
> [...]
> :Note that for duplicate arguments, only the right-most value is likely to
> :evaluated; for example foo(name => $tied1, name => $tied2) would likely
> :only call (tied $tied2)->FETCH(), although we don't guarantee this.
> Such a guarantee would be useful for the foo(%defaults, %options) idiom.

That's not obvious to me, Could you expand upon it?

"Foul and greedy Dwarf - you have eaten the last candle."
    -- "Hordes of the Things", BBC Radio. Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About