<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Day 3: static types and multi subs</title>
	<atom:link href="http://perl6advent.wordpress.com/2009/12/03/day-3-static-types-and-multi-subs/feed/" rel="self" type="application/rss+xml" />
	<link>http://perl6advent.wordpress.com/2009/12/03/day-3-static-types-and-multi-subs/</link>
	<description>Something cool about Perl 6 every day</description>
	<lastBuildDate>Sun, 03 Feb 2013 05:15:50 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: 扶凯 &#187; [Perl6] static types and multi subs</title>
		<link>http://perl6advent.wordpress.com/2009/12/03/day-3-static-types-and-multi-subs/#comment-904</link>
		<dc:creator><![CDATA[扶凯 &#187; [Perl6] static types and multi subs]]></dc:creator>
		<pubDate>Tue, 27 Sep 2011 15:19:45 +0000</pubDate>
		<guid isPermaLink="false">http://perl6advent.wordpress.com/?p=53#comment-904</guid>
		<description><![CDATA[[...] By wolfman2000：http://perl6advent.wordpress.com/2009/12/03/day-3-static-types-and-multi-subs/ [...]]]></description>
		<content:encoded><![CDATA[<p>[...] By wolfman2000：http://perl6advent.wordpress.com/2009/12/03/day-3-static-types-and-multi-subs/ [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Perl 6 Advent Calendar на русском &#124; Ky6uk's Blog</title>
		<link>http://perl6advent.wordpress.com/2009/12/03/day-3-static-types-and-multi-subs/#comment-222</link>
		<dc:creator><![CDATA[Perl 6 Advent Calendar на русском &#124; Ky6uk's Blog]]></dc:creator>
		<pubDate>Fri, 25 Dec 2009 23:13:29 +0000</pubDate>
		<guid isPermaLink="false">http://perl6advent.wordpress.com/?p=53#comment-222</guid>
		<description><![CDATA[[...] циклов, операторах форматирования, статических типах, мета-операторах и приемах [...]]]></description>
		<content:encoded><![CDATA[<p>[...] циклов, операторах форматирования, статических типах, мета-операторах и приемах [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: День 3: статические типы и мульти-функции &#124; Ky6uk's Blog</title>
		<link>http://perl6advent.wordpress.com/2009/12/03/day-3-static-types-and-multi-subs/#comment-79</link>
		<dc:creator><![CDATA[День 3: статические типы и мульти-функции &#124; Ky6uk's Blog]]></dc:creator>
		<pubDate>Wed, 09 Dec 2009 18:35:24 +0000</pubDate>
		<guid isPermaLink="false">http://perl6advent.wordpress.com/?p=53#comment-79</guid>
		<description><![CDATA[[...] на русский язык третьей статьи из цикла Perl 6 Advent Calendar.  Пришло время открыть третью [...]]]></description>
		<content:encoded><![CDATA[<p>[...] на русский язык третьей статьи из цикла Perl 6 Advent Calendar.  Пришло время открыть третью [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sørensen</title>
		<link>http://perl6advent.wordpress.com/2009/12/03/day-3-static-types-and-multi-subs/#comment-56</link>
		<dc:creator><![CDATA[Sørensen]]></dc:creator>
		<pubDate>Mon, 07 Dec 2009 19:13:11 +0000</pubDate>
		<guid isPermaLink="false">http://perl6advent.wordpress.com/?p=53#comment-56</guid>
		<description><![CDATA[Ok ok, that makes a lot more sense than what I was thinking.  That&#039;s a good example, too.  I haven&#039;t before seen Perl 6 classes used in a constraints-based manner, only in a more inheritance-based manner (like C).  Very cool!  I guess I should just sit down and read the synopses...]]></description>
		<content:encoded><![CDATA[<p>Ok ok, that makes a lot more sense than what I was thinking.  That&#8217;s a good example, too.  I haven&#8217;t before seen Perl 6 classes used in a constraints-based manner, only in a more inheritance-based manner (like C).  Very cool!  I guess I should just sit down and read the synopses&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Moritz</title>
		<link>http://perl6advent.wordpress.com/2009/12/03/day-3-static-types-and-multi-subs/#comment-54</link>
		<dc:creator><![CDATA[Moritz]]></dc:creator>
		<pubDate>Mon, 07 Dec 2009 18:57:31 +0000</pubDate>
		<guid isPermaLink="false">http://perl6advent.wordpress.com/?p=53#comment-54</guid>
		<description><![CDATA[No, a string of digits is still a string. The multi dispatcher doesn&#039;t do any type conversions for you.

What I meant is the following: You have a type A, and B inherits from A. If you have a variable with type constraint A, but it contains a B, then C++ dispatches with the type constraint (A), while Perl 6 dispatches with the actual type (B). My attempt to make it more concrete:

&lt;pre&gt;
class A { };
class B { };

multi sub f(A $x) { say &#039;A&#039; }
multi sub f(B $x) { say &#039;B&#039; }

my A $x = B.new;
f(b)   # says B
&lt;/pre&gt;

And in C++:

&lt;pre&gt;
#include &lt;iostream&gt; 
using namespace std;

class A { };
class B : public A { };

void f(A x) { cout &lt;&lt; &quot;A\n&quot;; }
void f(B x) { cout &lt;&lt; &quot;B\n&quot;; }

int main (int argc, char** argv) {
    A obj = B();
    f(obj); // prints A
    return 0;
}
&lt;/pre&gt;]]></description>
		<content:encoded><![CDATA[<p>No, a string of digits is still a string. The multi dispatcher doesn&#8217;t do any type conversions for you.</p>
<p>What I meant is the following: You have a type A, and B inherits from A. If you have a variable with type constraint A, but it contains a B, then C++ dispatches with the type constraint (A), while Perl 6 dispatches with the actual type (B). My attempt to make it more concrete:</p>
<pre>
class A { };
class B { };

multi sub f(A $x) { say 'A' }
multi sub f(B $x) { say 'B' }

my A $x = B.new;
f(b)   # says B
</pre>
<p>And in C++:</p>
<pre>
#include &lt;iostream&gt; 
using namespace std;

class A { };
class B : public A { };

void f(A x) { cout &lt;&lt; &quot;A\n&quot;; }
void f(B x) { cout &lt;&lt; &quot;B\n&quot;; }

int main (int argc, char** argv) {
    A obj = B();
    f(obj); // prints A
    return 0;
}
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sørensen</title>
		<link>http://perl6advent.wordpress.com/2009/12/03/day-3-static-types-and-multi-subs/#comment-52</link>
		<dc:creator><![CDATA[Sørensen]]></dc:creator>
		<pubDate>Mon, 07 Dec 2009 17:26:40 +0000</pubDate>
		<guid isPermaLink="false">http://perl6advent.wordpress.com/?p=53#comment-52</guid>
		<description><![CDATA[If you had a string of digits (say, read in from a config file), would those be recognized as of type Int at runtime..?   How does the runtime dispatch system figure out types and castings if you don&#039;t specify them at compile time?  Maybe I misunderstood your comment...]]></description>
		<content:encoded><![CDATA[<p>If you had a string of digits (say, read in from a config file), would those be recognized as of type Int at runtime..?   How does the runtime dispatch system figure out types and castings if you don&#8217;t specify them at compile time?  Maybe I misunderstood your comment&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Moritz</title>
		<link>http://perl6advent.wordpress.com/2009/12/03/day-3-static-types-and-multi-subs/#comment-45</link>
		<dc:creator><![CDATA[Moritz]]></dc:creator>
		<pubDate>Mon, 07 Dec 2009 12:54:13 +0000</pubDate>
		<guid isPermaLink="false">http://perl6advent.wordpress.com/?p=53#comment-45</guid>
		<description><![CDATA[Yes. Though contrary to C++ the dispatch happens at run time, so it considers the actual type of the arguments, and not the (generally broader) type known at compile time.]]></description>
		<content:encoded><![CDATA[<p>Yes. Though contrary to C++ the dispatch happens at run time, so it considers the actual type of the arguments, and not the (generally broader) type known at compile time.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris</title>
		<link>http://perl6advent.wordpress.com/2009/12/03/day-3-static-types-and-multi-subs/#comment-40</link>
		<dc:creator><![CDATA[Chris]]></dc:creator>
		<pubDate>Mon, 07 Dec 2009 04:19:25 +0000</pubDate>
		<guid isPermaLink="false">http://perl6advent.wordpress.com/?p=53#comment-40</guid>
		<description><![CDATA[Quick question Multi-sub are simple multiple dispatch based on the argument types, right?]]></description>
		<content:encoded><![CDATA[<p>Quick question Multi-sub are simple multiple dispatch based on the argument types, right?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bened</title>
		<link>http://perl6advent.wordpress.com/2009/12/03/day-3-static-types-and-multi-subs/#comment-21</link>
		<dc:creator><![CDATA[bened]]></dc:creator>
		<pubDate>Fri, 04 Dec 2009 14:16:14 +0000</pubDate>
		<guid isPermaLink="false">http://perl6advent.wordpress.com/?p=53#comment-21</guid>
		<description><![CDATA[I forgot to mention: Great entry! I&#039;m really anxious to see where optional static typing will lead the community code-wise.]]></description>
		<content:encoded><![CDATA[<p>I forgot to mention: Great entry! I&#8217;m really anxious to see where optional static typing will lead the community code-wise.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: wolfman2000</title>
		<link>http://perl6advent.wordpress.com/2009/12/03/day-3-static-types-and-multi-subs/#comment-18</link>
		<dc:creator><![CDATA[wolfman2000]]></dc:creator>
		<pubDate>Thu, 03 Dec 2009 14:49:46 +0000</pubDate>
		<guid isPermaLink="false">http://perl6advent.wordpress.com/?p=53#comment-18</guid>
		<description><![CDATA[Silly mistake. The elves must not have packaged the fits in right. Either way, it should be fixed now.]]></description>
		<content:encoded><![CDATA[<p>Silly mistake. The elves must not have packaged the fits in right. Either way, it should be fixed now.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
