<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"><html dir="ltr"><head>
<meta content="MSHTML 6.00.3790.2577" name="GENERATOR"></head>
<body ocsi="0">
<div>
<font face="Tahoma" color="#000000" size="2">Yes, I actually didn't realize that this worked w/ non generic parameters - but it does.&nbsp; I'm not sure if we have a good description of his but I'll look around and/or see if we can get something on the Wiki.</font></div>
<div>
<font face="tahoma" size="2"></font>&nbsp;</div>
<hr tabindex="-1">
<font face="Tahoma" size="2"><b>From:</b> users-bounces@lists.ironpython.com On Behalf Of J. Merrill<br>
<b>Sent:</b> Monday, January 09, 2006 7:41 PM<br>
<b>To:</b> Discussion of IronPython<br>
<b>Subject:</b> Re: [IronPython] Method overload<br>
</font><br>
<div>
</div>
<div style="POSITION: relative">
Couldn't I use the [] syntax to tell IP what .Net type to use for eachparameter?&nbsp; (Where is there a good description of the [] syntax?)<br>
<br>
At 01:05 PM 1/9/2006, Dino Viehland wrote<br>
<br>
<blockquote type="cite">
<font face="arial" color="#000080" size="2">The [] syntax is for generic types - not for method overloads.&nbsp; <br>
</font><br>
<font face="arial" color="#000080" size="2">&nbsp;<br>
</font><br>
<font face="arial" color="#000080" size="2">Just for more info on method overloads in general for those that have multiple method bindings we ll hit our ReflectedMethodBase.TryCall implementation.&nbsp; That will evaluate the conversions for each argument and methods and will ultimately dispatch to the method that has better conversions.&nbsp; If two methods have mixed conversions [(one good , one bad ) / (one bad , one good ) ] then we ll just end up picking the first method.&nbsp; We also take into account various other factors such as if we re turning the first argument into a this pointer and we ll have non-params arguments over params arguments.&nbsp; It s also worth pointing out this whole process is slow&amp;.<br>
</font><br>
<font face="arial" color="#000080" size="2">&nbsp;<br>
</font><br>
<font face="arial" color="#000080" size="2">For optimized calls (currently just core built-in CLR types and types the IronPython runtime exposes) we ll generate fast-paths for methods that don t have multiple bindings.&nbsp; Our definition of multiple bindings is methods that have 1 overload for each number of parameters (eg 1 overload that takes 1 parameter, 1 overload that takes 2 parameters, etc&amp;) and methods that only have 1 params method.&nbsp; If the method falls outside of this it s not optimized.&nbsp; That s an implementation detail that probably no one needs to know, but I m just throwing it out there for completeness.&nbsp; We re also looking at improving our optimizer so it can optimize more methods this way (and there probably deserves some thought about how we can allow user-methods to be optimized when hosting IronPython as well).<br>
</font><br>
<font face="arial" color="#000080" size="2">&nbsp;<br>
<hr>

<div align="center">
</font></div>
<font face="tahoma" size="2"><b>From:</b> users-bounces@lists.ironpython.com [<a href="mailto:users-bounces@lists.ironpython.com">mailto:users-bounces@lists.ironpython.com</a>] <b>On Behalf Of </b>J. Merrill<br>
<b>Sent:</b> Monday, January 09, 2006 9:32 AM<br>
<b>To:</b> Discussion of IronPython<br>
<b>Subject:</b> Re: [IronPython] Method overload<br>
</font><br>
<font face="Times New Roman, Times">&nbsp;<br>
</font><br>
<font face="Times New Roman, Times">Isn't there a syntax (using []) by which you can tell IP explicitly which one it should use?&nbsp; I was expecting you to say what you did, but to add info about that as well.<br>
<br>
At 12:48 AM 1/8/2006, Martin Maly wrote<br>
<br>
</font><font face="verdana" color="#800000" size="2">Yes, it will work on .NET. IronPython will try to find the best fit among the overloads based on types of arguments that you pass to the method call. There may be cases when IronPython may not choose the right method &amp; and we want to hear about those cases so we can fix them.<br>
</font><br>
<font face="verdana" color="#800000" size="2">Martin<br>
<hr>

<div align="center">
</font></div>
<font face="tahoma" size="2"><b>From:</b> users-bounces@lists.ironpython.com [<a href="mailto:users-bounces@lists.ironpython.com">mailto:users-bounces@lists.ironpython.com</a>] <b>On Behalf Of </b>Fabio<br>
<b>Sent:</b> Saturday, January 07, 2006 4:42 PM<br>
<b>To:</b> IronPython<br>
<b>Subject:</b> [IronPython] Method overload<br>
</font><br>
I'm studing IronPython and I liked very much!<br>
But I have one question.<br>
<br>
In .Net Framework, several classes has method overload. In my study, Python does not support method overload, and when we define&nbsp; methods with the same name, they are redefined then only the last is used.<br>
<br>
How IronPython handle this? By example, the method &quot;<font size="2">System.Console.Write()&quot; has 18 overloads! This will work in .Net?<br>
</font><br>
<font size="2">Regards<br>
Fabio</font></blockquote>
<br>
<br>
J. Merrill / Analytical Software Corp </div>
</body></html>