<?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 22: Operator Overloading</title>
	<atom:link href="http://perl6advent.wordpress.com/2009/12/22/day-22-operator-overloading/feed/" rel="self" type="application/rss+xml" />
	<link>http://perl6advent.wordpress.com/2009/12/22/day-22-operator-overloading/</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: Moritz</title>
		<link>http://perl6advent.wordpress.com/2009/12/22/day-22-operator-overloading/#comment-211</link>
		<dc:creator><![CDATA[Moritz]]></dc:creator>
		<pubDate>Wed, 23 Dec 2009 17:44:17 +0000</pubDate>
		<guid isPermaLink="false">http://perl6advent.wordpress.com/?p=350#comment-211</guid>
		<description><![CDATA[postcircumfix operators are methods, and they are called on the object being postcircumfixed, so the method can refer to that object with the keyword &lt;code&gt;self&lt;/code&gt;.]]></description>
		<content:encoded><![CDATA[<p>postcircumfix operators are methods, and they are called on the object being postcircumfixed, so the method can refer to that object with the keyword <code>self</code>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joe Z</title>
		<link>http://perl6advent.wordpress.com/2009/12/22/day-22-operator-overloading/#comment-198</link>
		<dc:creator><![CDATA[Joe Z]]></dc:creator>
		<pubDate>Tue, 22 Dec 2009 20:32:21 +0000</pubDate>
		<guid isPermaLink="false">http://perl6advent.wordpress.com/?p=350#comment-198</guid>
		<description><![CDATA[Ah, ok, that clears it up. 

I was pretty sure I had a handle on circumfix--I had rightly guessed the &quot;around&quot; connotation of the &quot;circum-&quot; prefix.  It was &quot;postcircumfix&quot; that threw me off the scent, though.  I was left thinking &quot;Wait, if it&#039;s &#039;around&#039;, how can it also be &#039;after&#039;?&quot;  After all, there isn&#039;t a &quot;precircumfix&quot; or &quot;incircumfix&quot;.  :-)

So, with a postcircumfix operator, is the item that comes before also an argument to the operator? For example, given &quot;@bar[1, 2, 3]&quot;, is @bar also an argument to :postcircumfix&lt;[]&gt; ?

(Here&#039;s hoping my angle brackets didn&#039;t get mangled, and that I didn&#039;t goof the syntax too badly... Perl 6 syntax is rather notably different from Perl 5 in ways that still occasionally elude me.)]]></description>
		<content:encoded><![CDATA[<p>Ah, ok, that clears it up. </p>
<p>I was pretty sure I had a handle on circumfix&#8211;I had rightly guessed the &#8220;around&#8221; connotation of the &#8220;circum-&#8221; prefix.  It was &#8220;postcircumfix&#8221; that threw me off the scent, though.  I was left thinking &#8220;Wait, if it&#8217;s &#8216;around&#8217;, how can it also be &#8216;after&#8217;?&#8221;  After all, there isn&#8217;t a &#8220;precircumfix&#8221; or &#8220;incircumfix&#8221;.  :-)</p>
<p>So, with a postcircumfix operator, is the item that comes before also an argument to the operator? For example, given &#8220;@bar[1, 2, 3]&#8220;, is @bar also an argument to :postcircumfix&lt;[]&gt; ?</p>
<p>(Here&#8217;s hoping my angle brackets didn&#8217;t get mangled, and that I didn&#8217;t goof the syntax too badly&#8230; Perl 6 syntax is rather notably different from Perl 5 in ways that still occasionally elude me.)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: carl</title>
		<link>http://perl6advent.wordpress.com/2009/12/22/day-22-operator-overloading/#comment-197</link>
		<dc:creator><![CDATA[carl]]></dc:creator>
		<pubDate>Tue, 22 Dec 2009 12:46:56 +0000</pubDate>
		<guid isPermaLink="false">http://perl6advent.wordpress.com/?p=350#comment-197</guid>
		<description><![CDATA[S06 is silent on any advantages of putting the return type inside the parentheses, so I&#039;ll resort to ad-hoc blabbering instead. :)

The parentheses construct a Signature object which latches onto the routine. Having the &#039;--&gt; RetType&#039; inside of the parentheses means that it&#039;s clearer that the return type forms a part of the Signature, and can be introspected along with the parameters.

On the other hand, pointy blocks (see S06) show that Perl 6 sometimes employs syntax where things which are semantically &#039;inside&#039; an object are syntactically placed outside that object. So I guess that&#039;s not really a defendable reason.

Starting from another angle, the Signature can be seen as a contract with the caller, essentially promising &quot;if you give me $a, $b and $c of some specified types, I will return RetType (if and when I return normally)&quot;. Seen as a contract, the Signature may as well keep the return type, representing the part of the bargain that the routine has promised to uphold.

A third aspect of this, again speaking in your favour, is that Signatures are used as the LHS of list assignments in Perl 6. (A generalization which excites and surprises me.) In this case, I have no idea what a return type might mean; applying the argument from ignorance gives that it shouldn&#039;t be there in the first place. :)]]></description>
		<content:encoded><![CDATA[<p>S06 is silent on any advantages of putting the return type inside the parentheses, so I&#8217;ll resort to ad-hoc blabbering instead. :)</p>
<p>The parentheses construct a Signature object which latches onto the routine. Having the &#8216;&#8211;&gt; RetType&#8217; inside of the parentheses means that it&#8217;s clearer that the return type forms a part of the Signature, and can be introspected along with the parameters.</p>
<p>On the other hand, pointy blocks (see S06) show that Perl 6 sometimes employs syntax where things which are semantically &#8216;inside&#8217; an object are syntactically placed outside that object. So I guess that&#8217;s not really a defendable reason.</p>
<p>Starting from another angle, the Signature can be seen as a contract with the caller, essentially promising &#8220;if you give me $a, $b and $c of some specified types, I will return RetType (if and when I return normally)&#8221;. Seen as a contract, the Signature may as well keep the return type, representing the part of the bargain that the routine has promised to uphold.</p>
<p>A third aspect of this, again speaking in your favour, is that Signatures are used as the LHS of list assignments in Perl 6. (A generalization which excites and surprises me.) In this case, I have no idea what a return type might mean; applying the argument from ignorance gives that it shouldn&#8217;t be there in the first place. :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: VZ</title>
		<link>http://perl6advent.wordpress.com/2009/12/22/day-22-operator-overloading/#comment-196</link>
		<dc:creator><![CDATA[VZ]]></dc:creator>
		<pubDate>Tue, 22 Dec 2009 12:26:03 +0000</pubDate>
		<guid isPermaLink="false">http://perl6advent.wordpress.com/?p=350#comment-196</guid>
		<description><![CDATA[Sorry, looks like I put my foot in my mouth yet again. I really had no idea that this syntax was valid so I didn&#039;t even think to double check it. Sorry again.

But I do wonder what is the rationale for having &quot;--&gt; RetType&quot; inside the parentheses, it seems rather counter-intuitive to me to mix it with the parameters declaration. OTOH maybe it&#039;s again my C++ background getting through as C++0x now allows either

RetType foo(T a, U b);

or

[] foo(T a, U b) -&gt; RetType;

which is similar to Perl6 way.]]></description>
		<content:encoded><![CDATA[<p>Sorry, looks like I put my foot in my mouth yet again. I really had no idea that this syntax was valid so I didn&#8217;t even think to double check it. Sorry again.</p>
<p>But I do wonder what is the rationale for having &#8220;&#8211;&gt; RetType&#8221; inside the parentheses, it seems rather counter-intuitive to me to mix it with the parameters declaration. OTOH maybe it&#8217;s again my C++ background getting through as C++0x now allows either</p>
<p>RetType foo(T a, U b);</p>
<p>or</p>
<p>[] foo(T a, U b) -&gt; RetType;</p>
<p>which is similar to Perl6 way.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: carl</title>
		<link>http://perl6advent.wordpress.com/2009/12/22/day-22-operator-overloading/#comment-195</link>
		<dc:creator><![CDATA[carl]]></dc:creator>
		<pubDate>Tue, 22 Dec 2009 12:17:19 +0000</pubDate>
		<guid isPermaLink="false">http://perl6advent.wordpress.com/?p=350#comment-195</guid>
		<description><![CDATA[Maybe you&#039;re used to the other permissible way of specifying return types in Perl 6: &lt;code&gt;RetType sub foo($a, $b, $c) { ... }&lt;/code&gt;.

But specifying the return type inside of the signature is perfectly OK too: &lt;code&gt;sub foo($a, $b, $c --&gt; RetType) { ... }&lt;/code&gt;.

Note the two dashes in the arrow, by the way.]]></description>
		<content:encoded><![CDATA[<p>Maybe you&#8217;re used to the other permissible way of specifying return types in Perl 6: <code>RetType sub foo($a, $b, $c) { ... }</code>.</p>
<p>But specifying the return type inside of the signature is perfectly OK too: <code>sub foo($a, $b, $c --&gt; RetType) { ... }</code>.</p>
<p>Note the two dashes in the arrow, by the way.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: VZ</title>
		<link>http://perl6advent.wordpress.com/2009/12/22/day-22-operator-overloading/#comment-194</link>
		<dc:creator><![CDATA[VZ]]></dc:creator>
		<pubDate>Tue, 22 Dec 2009 11:23:27 +0000</pubDate>
		<guid isPermaLink="false">http://perl6advent.wordpress.com/?p=350#comment-194</guid>
		<description><![CDATA[There is a typo in infix == definition for PieceOfString, I think: &quot;--&gt; Bool&quot; should be outside of parentheses, not inside them.]]></description>
		<content:encoded><![CDATA[<p>There is a typo in infix == definition for PieceOfString, I think: &#8220;&#8211;&gt; Bool&#8221; should be outside of parentheses, not inside them.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: carl</title>
		<link>http://perl6advent.wordpress.com/2009/12/22/day-22-operator-overloading/#comment-192</link>
		<dc:creator><![CDATA[carl]]></dc:creator>
		<pubDate>Tue, 22 Dec 2009 06:58:13 +0000</pubDate>
		<guid isPermaLink="false">http://perl6advent.wordpress.com/?p=350#comment-192</guid>
		<description><![CDATA[Hi, avid reader! &quot;Circumfix&quot; refers to operators which occur both before and after their operand. Parentheses and brackets are a good example. (The &quot;circum-&quot; is the same as in &quot;circumference&quot; or &quot;circumvent&quot;.)

&quot;Postcircumfix&quot; also surround things, but besides doing that, they also come after something else. Again, parentheses and brackets are a good example. :) The parentheses in &#039;(1, 2, 3)&#039; work differently than the parentheses in &#039;foo(1, 2, 3)&#039;, because the latter are a postcircumfix. Ditto &#039;[1, 2, 3]&#039; and &#039;@bar[1, 2, 3]&#039;.

The parser in Perl 6 works in such a way that it&#039;s never confused about whether it expects a circumfix or a postcircumfix. The &#039;tax&#039; we as users pay for that is that we have to make sure we get the whitespace right. Specifically, there must be no whitespace between a postcircumfix operator and the thing that precedes it. So &#039;say(1, 2, 3)&#039; and &#039;say (1, 2, 3)&#039; mean &quot;print three things&quot; and &quot;print one thing&quot;, respectively. For the rare cases when you really want to separate things and still have a postcircumfix, there&#039;s something called an &#039;unspace&#039;: a backslash followed by any amount of whitespace, like this: &#039;say\ (1, 2, 3)&#039;.]]></description>
		<content:encoded><![CDATA[<p>Hi, avid reader! &#8220;Circumfix&#8221; refers to operators which occur both before and after their operand. Parentheses and brackets are a good example. (The &#8220;circum-&#8221; is the same as in &#8220;circumference&#8221; or &#8220;circumvent&#8221;.)</p>
<p>&#8220;Postcircumfix&#8221; also surround things, but besides doing that, they also come after something else. Again, parentheses and brackets are a good example. :) The parentheses in &#8216;(1, 2, 3)&#8217; work differently than the parentheses in &#8216;foo(1, 2, 3)&#8217;, because the latter are a postcircumfix. Ditto &#8216;[1, 2, 3]&#8216; and &#8216;@bar[1, 2, 3]&#8216;.</p>
<p>The parser in Perl 6 works in such a way that it&#8217;s never confused about whether it expects a circumfix or a postcircumfix. The &#8216;tax&#8217; we as users pay for that is that we have to make sure we get the whitespace right. Specifically, there must be no whitespace between a postcircumfix operator and the thing that precedes it. So &#8216;say(1, 2, 3)&#8217; and &#8216;say (1, 2, 3)&#8217; mean &#8220;print three things&#8221; and &#8220;print one thing&#8221;, respectively. For the rare cases when you really want to separate things and still have a postcircumfix, there&#8217;s something called an &#8216;unspace&#8217;: a backslash followed by any amount of whitespace, like this: &#8216;say\ (1, 2, 3)&#8217;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joe Z</title>
		<link>http://perl6advent.wordpress.com/2009/12/22/day-22-operator-overloading/#comment-191</link>
		<dc:creator><![CDATA[Joe Z]]></dc:creator>
		<pubDate>Tue, 22 Dec 2009 03:33:43 +0000</pubDate>
		<guid isPermaLink="false">http://perl6advent.wordpress.com/?p=350#comment-191</guid>
		<description><![CDATA[So what are &quot;circumfix&quot; and &quot;postcircumfix&quot;?]]></description>
		<content:encoded><![CDATA[<p>So what are &#8220;circumfix&#8221; and &#8220;postcircumfix&#8221;?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: colomon</title>
		<link>http://perl6advent.wordpress.com/2009/12/22/day-22-operator-overloading/#comment-189</link>
		<dc:creator><![CDATA[colomon]]></dc:creator>
		<pubDate>Tue, 22 Dec 2009 01:30:31 +0000</pubDate>
		<guid isPermaLink="false">http://perl6advent.wordpress.com/?p=350#comment-189</guid>
		<description><![CDATA[Fixed.]]></description>
		<content:encoded><![CDATA[<p>Fixed.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: colomon</title>
		<link>http://perl6advent.wordpress.com/2009/12/22/day-22-operator-overloading/#comment-188</link>
		<dc:creator><![CDATA[colomon]]></dc:creator>
		<pubDate>Tue, 22 Dec 2009 01:29:05 +0000</pubDate>
		<guid isPermaLink="false">http://perl6advent.wordpress.com/?p=350#comment-188</guid>
		<description><![CDATA[Good catch!]]></description>
		<content:encoded><![CDATA[<p>Good catch!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
