That makes sense.

Thank you!

On Mon, Jul 3, 2017 at 8:09 PM jn...@jnthn.net via RT <
perl6-bugs-follo...@perl.org> wrote:

> On Fri, 30 Jun 2017 06:41:35 -0700, lloyd.fo...@gmail.com wrote:
> > sub foo( %h ( :$foo = "bar", :$baz) ) {
> >     %h;
> > }
> >
> > note foo( { :baz } ); #-> {baz => True}
> >
> > If it's not an easy fix it might warrant a "not yet implemented"
> exception.
>
> It works correctly. Doing:
>
> sub foo( %h ( :$foo = "bar", :$baz) ) {
>     say $foo
> }
> foo({ foo => "baz" });
> foo({ baz => 42 });
>
> Gives the output:
>
> baz
> bar
>
> So, $foo is correctly set to the default when the hash is missing that
> key. You seem to be expecting that it would modify the original hash that
> was passed in. That is (very intentionally) not the case.
>
> /jnthn
>

Reply via email to