On Wed, May 26, 2010 at 07:22:36AM -0700, jerry gay wrote: : On Wed, May 26, 2010 at 00:53, Moritz Lenz <mor...@faui2k3.org> wrote: : > The spec doesn't elaborate on how the short args are specified in the : > signature of MAIN. I see two possible approaches (that don't contradict): : > : > 1) one renames them in the signature, so it would like : > : > sub MAIN(:name(:$n)) : > : > then $n has two names, 'name' and 'n', and we could consider all one-letter : > parameter names as short names : > : this is what was intended in the spec. if you can update it to stamp : out the ambiguity, that would be most welcome.
Yes, that was the intent. : > 2) Iterate over all named parameters and build unambiguous prefixes. If any : > of them is just one letter short, we consider it a short name. : > : > : > Anz opinions from p6l about it? : > : this method has too much magic. And also too little magic, insofar as it won't guess which options deserve precedence over another due to frequency of use. Also, it's a bit antisocial to get people used to using certain short switches and then cancel them out when they get ambiguous. If you're going to have a mechanism for forcing short ones, then we already have #1 above, and the intermediate names are not terribly useful, because people will tend to prefer the extremes most of the time. And if you want a particular program to behave the other way, you can pull in all the switches with *%args and then do your own key matching with the <*name> forms, assuming it's implemented, and plays nice in alternations, LTMishly speaking. Larry