On Sat, Oct 8, 2022 at 3:18 PM Ovid <curtis.poe@gmail.com> wrote: > That being said, :\@foo compounds Perl's reputation for linenoise. Can we > come up with a rule to avoid this? My first thought is: > > "Rule 2: named parameters are scalars, with the scalar constrained to an > array or hash reference, if needed." > > Ouch. I rewrote this email after I rethought things in terms of non-flattening variables instead of references, but I forgot to fix rule 2. "Rule 2: named parameters correspond to their named arguments without flattening, unless explicit name/value pairs are used." That leads to two calling conventions: foo( bar => $bar, baz => \@baz, quux => \%quux ); # versus foo( :$bar, :@baz, :%quux ); In this case, TIMTOWTDI seems confusing because the second syntax seems much cleaner (and concise) to me, but we'd still have to support the older syntax. Thus, we still need to have an exception to the rule. I am not sure that's avoidable, but we'd have the consistency of a leading colon for both arguments and parameters. Best, Curtis "Ovid" Poe -- CTO, All Around the World World-class software development and consulting https://allaroundtheworld.fr/Thread Previous | Thread Next