On Fri, 7 Oct 2022 10:42:23 +0100 Dave Mitchell <davem@iabyn.com> wrote: > I'd expect :@bar to be a syntax error. But note that in a separate > proposal, a \@ary parameter auto-dereferences and aliases a passed > array ref, as in > > sub foo(\@numbers) { say "@numbers" } > foo([1,2,3]); # prints "1 2 3" > > This can be combined separately with named parameters, giving > > sub foo(\:@numbers) { say "@numbers" } > foo("numbers => [1,2,3]); # prints "1 2 3" My thoughts: sub named(:$x, :$y) # looks nice sub no_slurpy(:@nums) # should be banned sub dereffed(\@values) # again looks nice However, sub named_deref(:\@x) # I think I'd prefer this spelling To my eye, `:\@arr` looks and feels a bit better than `\:@arr` does. Since we're banning `:@arr`, we learn to avoid a colon next to an at or percent sign. It also fits better with what you'd pass in from the callsite my $result = named_deref\@values_for_x); -- Paul "LeoNerd" Evans leonerd@leonerd.org.uk | https://metacpan.org/author/PEVANS http://www.leonerd.org.uk/ | https://www.tindie.com/stores/leonerd/Thread Previous | Thread Next