On Fri, Aug 19, 2005 at 06:30:41PM +0300, Yuval Kogman wrote: : On Fri, Aug 19, 2005 at 10:31:34 +0000, Luke Palmer wrote: : : In short, "me too". : : Now some comments: : : > foo($a, $b, $c) : > : > You *know* that you're passing three positionals. : : This is very very important for least surprise and all that.
Yes, that's why we were already syntacticalizing with the *%foo proposal. : > It's much less work for the runtime. You don't have to scan for : > pairs, you just have the caller stuff them where you need them. : : This will also allow more static binding of named parameters, which : is a good thing, because it will simplify the type inferencer code. That too. : > You only lose a *little* bit of flexibility at a great gain of : > usability of pairs. That little bit is this ability: : > : > my @args = (1, 2, 3, foo => 'bar'); : > baz([EMAIL PROTECTED]); # $foo gets argument 'bar' : : To be honest, I don't see how that is a feature, this strengthens my : support for demagicalizing. Seems to me that the * processor could easily install a pair-to-named promoter if that was deemed to be desirable. The * already says you're cheating. Alternately, instead of a normal list composer, have one that generates a special list that is predigested into zones. my @args := arglist(1, 2, 3, :foo('bar') <== @slurpme); baz([EMAIL PROTECTED]); # Just Works Presumably we need that funny list type anyway to collect named vs positionals vs slurpies at compile time, so all we need to do is expose that type via arglist() or whatever we call it. Maybe it's just my @args := ArgList.new(1, 2, 3, :foo('bar') <== @slurpme); Doesn't have to be Huffshort. Larry