<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:st1="urn:schemas-microsoft-com:office:smarttags" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]--><o:SmartTagType
 namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="PersonName"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:"MS Mincho";
        panose-1:2 2 6 9 4 2 5 8 3 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:"\@MS Mincho";
        panose-1:2 2 6 9 4 2 5 8 3 4;}
@font-face
        {font-family:Verdana;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:blue;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</style>

</head>

<body lang=EN-US link=blue vlink=blue>

<div class=Section1>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>The [] syntax is for generic types - not
for method overloads. &nbsp;<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Just for more info on method overloads in
general &#8211; for those that have multiple method bindings we&#8217;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 &#8220;mixed&#8221;
conversions [(one &#8220;good&#8221;, one &#8220;bad&#8221;) / (one &#8220;bad&#8221;,
one &#8220;good&#8221;) ] then we&#8217;ll just end up picking the first
method. &nbsp;We also take into account various other factors such as if we&#8217;re
turning the first argument into a this pointer and we&#8217;ll have non-params
arguments over params arguments.&nbsp; It&#8217;s also worth pointing out this
whole process is slow&#8230;.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>For optimized calls (currently just core
built-in CLR types and types the IronPython runtime exposes) we&#8217;ll
generate fast-paths for methods that don&#8217;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&#8230;) and methods that only have 1 params method. &nbsp;If the method
falls outside of this it&#8217;s not optimized.&nbsp; That&#8217;s an
implementation detail that probably no one needs to know, but I&#8217;m just
throwing it out there for completeness. &nbsp;We&#8217;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).<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<div>

<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>

<hr size=2 width="100%" align=center tabindex=-1>

</span></font></div>

<p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:</span></font></b><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>
users-bounces@lists.ironpython.com [mailto:users-bounces@lists.ironpython.com] <b><span
style='font-weight:bold'>On Behalf Of </span></b>J. Merrill<br>
<b><span style='font-weight:bold'>Sent:</span></b> Monday, January 09, 2006
9:32 AM<br>
<b><span style='font-weight:bold'>To:</span></b> <st1:PersonName w:st="on">Discussion
 of IronPython</st1:PersonName><br>
<b><span style='font-weight:bold'>Subject:</span></b> Re: [IronPython] Method
overload</span></font><o:p></o:p></p>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>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>
<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=maroon face=Verdana><span
style='font-size:10.0pt;font-family:Verdana;color:maroon'>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>
</span></font><br>
<font size=2 color=maroon face=Verdana><span style='font-size:10.0pt;
font-family:Verdana;color:maroon'>Martin<o:p></o:p></span></font></p>

<div class=MsoNormal align=center style='text-align:center'><font size=2
color=maroon face=Verdana><span style='font-size:10.0pt;font-family:Verdana;
color:maroon'>

<hr size=2 width="100%" align=center>

</span></font></div>

<p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:</span></font></b><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>
users-bounces@lists.ironpython.com [<a
href="mailto:users-bounces@lists.ironpython.com" eudora=autourl>mailto:users-bounces@lists.ironpython.com</a>]
<b><span style='font-weight:bold'>On Behalf Of </span></b>Fabio<br>
<b><span style='font-weight:bold'>Sent:</span></b> Saturday, January 07, 2006
4:42 PM<br>
<b><span style='font-weight:bold'>To:</span></b> IronPython<br>
<b><span style='font-weight:bold'>Subject:</span></b> [IronPython] Method
overload<br>
</span></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><span
style='font-size:10.0pt'>System.Console.Write()&quot; has 18 overloads! This
will work in .Net?<br>
</span></font><br>
<font size=2><span style='font-size:10.0pt'>Regards<br>
Fabio</span></font><o:p></o:p></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><br>
<br>
J. Merrill / Analytical Software Corp <o:p></o:p></span></font></p>

</div>

</body>

</html>