On Sat, Mar 27, 2004 at 03:27:04AM +0100, Marc Lehmann wrote: > On Thu, Mar 25, 2004 at 07:48:59PM -0800, Manish Singh <yosh@xxxxxxxx> wrote: > > So what would be a good way for perl to support both named and positional > > stuff? > > It simply shouldn't. It should either do positional where it is useful > and named where it is useful. Or always named. Everything else (like a > hashref) is just madness and should be handled by a different interface > (call_procedure_hashref...). > > Please note that it doesn't make _any_ sense to have 100% named parameters > for the majority of functions (e.g. all fucntions having an image, or > layer etc. as leading arguments, as these should be handled using method > syntax). No, but it's nice to be flexible and have the option of doing things with method syntax or procedural syntax. Isn't an important Perl motto TMTOWTDI? :) Perhaps the OO syntax should always expect named parameters, but non-OO syntax should offer both in some fashion, like a hashref, or some sort of marker to say "named parameters start here". > Most languages share this problem, so it would be interetsing how this > would be solved in C for example (probably using a different interface). Python supports positional and named arguments natively, and we've talked about workable solutions in Scheme. In C it's a pain in the ass to call PDB functions at all, so no big deal to have two interfaces. But I'd like to do better in more dynamic languages. -Yosh