Oliver Jowett wrote:
> Gaetano Mendola wrote: > >> Oliver Jowett wrote: >> >>> Gaetano Mendola wrote: >>> >>>> Oliver Jowett wrote: >>>> >>>>> David Fetter wrote: >>>>> >>>>>> Dennis has pointed out that mixing the call-with-named-parameter >>>>>> interface with call-by-order-of-parameters one would cause confusion, >>>>> >>>>> >>>>> >>>>> >>>>> Python's equivalent syntax allows you to mix the two forms so long >>>>> as all the by-position parameters come first: >>>>> >>>> python don't have overloaded functions... >>> >>> >>> It doesn't change how you'd handle overloaded functions; you still >>> have a type for every parameter available. >> >> >> >> I think will be a mess that will break the "minor surprise" principle, >> even the bad C++ stays away from this field ( se explicit constructors, >> and automatic cast limited to only one level ). > > > I don't understand your argument. What is the surprising behaviour you > are worried about?
I'm worried about:
(1) foo( integer, float); (2) foo( integer, integer, float a = 3 );
which one is called with: foo( 2, 2 )?
the first one because have two parameters or the second one that better match the arguments ?
Whatever policy we adopt someone could argue that the (2) have a signature with 3 parameters so the (1) shall be called, and someone can argue that (2) is equivalent to:
(2a) foo(integer, integer) (2b) foo(integer, integer, float);
so the (2) have to be called.
BTW C++ adopt the latter.
Regards Gaetano Mendola
---------------------------(end of broadcast)--------------------------- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])