<?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 19 &#8211; False truth</title>
	<atom:link href="http://perl6advent.wordpress.com/2010/12/19/day-19-false-truth/feed/" rel="self" type="application/rss+xml" />
	<link>http://perl6advent.wordpress.com/2010/12/19/day-19-false-truth/</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: carl</title>
		<link>http://perl6advent.wordpress.com/2010/12/19/day-19-false-truth/#comment-614</link>
		<dc:creator><![CDATA[carl]]></dc:creator>
		<pubDate>Tue, 21 Dec 2010 05:00:50 +0000</pubDate>
		<guid isPermaLink="false">http://perl6advent.wordpress.com/?p=675#comment-614</guid>
		<description><![CDATA[Regardless of the object&#039;s type, when you write &lt;code&gt;prefix:&lt;?&gt;&lt;/code&gt;, that gets translated into &lt;code&gt;.Bool&lt;/code&gt;. You&#039;re absolutely right that the &lt;code&gt;.Bool&lt;/code&gt; method on the &lt;code&gt;Bool&lt;/code&gt; type doesn&#039;t do much; it basically looks like this:

&lt;pre&gt;method Bool { self }&lt;/pre&gt;

In other words, a kind of identity operation.

As to &lt;em&gt;why&lt;/em&gt; there&#039;d be a need to call the &lt;code&gt;.Bool&lt;/code&gt; method on something that&#039;s already &lt;code&gt;Bool&lt;/code&gt; (besides the trivial reason that it&#039;s always done): there&#039;s not really any good reason to do that... until someone overrides the method, as in this post. An optimizer that could &lt;em&gt;prove&lt;/em&gt; that no overriding has taken place would be free to remove the call.]]></description>
		<content:encoded><![CDATA[<p>Regardless of the object&#8217;s type, when you write <code>prefix:&lt;?&gt;</code>, that gets translated into <code>.Bool</code>. You&#8217;re absolutely right that the <code>.Bool</code> method on the <code>Bool</code> type doesn&#8217;t do much; it basically looks like this:</p>
<pre>method Bool { self }</pre>
<p>In other words, a kind of identity operation.</p>
<p>As to <em>why</em> there&#8217;d be a need to call the <code>.Bool</code> method on something that&#8217;s already <code>Bool</code> (besides the trivial reason that it&#8217;s always done): there&#8217;s not really any good reason to do that&#8230; until someone overrides the method, as in this post. An optimizer that could <em>prove</em> that no overriding has taken place would be free to remove the call.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: skids</title>
		<link>http://perl6advent.wordpress.com/2010/12/19/day-19-false-truth/#comment-609</link>
		<dc:creator><![CDATA[skids]]></dc:creator>
		<pubDate>Mon, 20 Dec 2010 20:49:43 +0000</pubDate>
		<guid isPermaLink="false">http://perl6advent.wordpress.com/?p=675#comment-609</guid>
		<description><![CDATA[The 42 example makes sense.

But, True is a already Bool; why would it call .Bool in order to be converted to a Bool?]]></description>
		<content:encoded><![CDATA[<p>The 42 example makes sense.</p>
<p>But, True is a already Bool; why would it call .Bool in order to be converted to a Bool?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: carl</title>
		<link>http://perl6advent.wordpress.com/2010/12/19/day-19-false-truth/#comment-587</link>
		<dc:creator><![CDATA[carl]]></dc:creator>
		<pubDate>Sun, 19 Dec 2010 11:14:42 +0000</pubDate>
		<guid isPermaLink="false">http://perl6advent.wordpress.com/?p=675#comment-587</guid>
		<description><![CDATA[Dan, what Christopher and Jesper said. The &quot;always return False&quot; role was just an example, and you can overload the .Bool method to return things according to rules as complex as you like.]]></description>
		<content:encoded><![CDATA[<p>Dan, what Christopher and Jesper said. The &#8220;always return False&#8221; role was just an example, and you can overload the .Bool method to return things according to rules as complex as you like.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jesper</title>
		<link>http://perl6advent.wordpress.com/2010/12/19/day-19-false-truth/#comment-583</link>
		<dc:creator><![CDATA[Jesper]]></dc:creator>
		<pubDate>Sun, 19 Dec 2010 08:33:49 +0000</pubDate>
		<guid isPermaLink="false">http://perl6advent.wordpress.com/?p=675#comment-583</guid>
		<description><![CDATA[Maybe it should be noted that this doesn&#039;t take away any functionality.

$r = run($cmd);
say $r == 42; # Still possible to do anything you&#039;d do with a number.
say ?($r + 0); # Will still say true according to the normal
# non-overloaded bool role; it&#039;s not poisonous.]]></description>
		<content:encoded><![CDATA[<p>Maybe it should be noted that this doesn&#8217;t take away any functionality.</p>
<p>$r = run($cmd);<br />
say $r == 42; # Still possible to do anything you&#8217;d do with a number.<br />
say ?($r + 0); # Will still say true according to the normal<br />
# non-overloaded bool role; it&#8217;s not poisonous.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jesper</title>
		<link>http://perl6advent.wordpress.com/2010/12/19/day-19-false-truth/#comment-582</link>
		<dc:creator><![CDATA[Jesper]]></dc:creator>
		<pubDate>Sun, 19 Dec 2010 08:26:21 +0000</pubDate>
		<guid isPermaLink="false">http://perl6advent.wordpress.com/?p=675#comment-582</guid>
		<description><![CDATA[I think run simply returns the process return values in this way:

return ($result == 0 ?? $result but True !! $result but False);

Thus returning a zero which tests true, or a nonzero which tests false.]]></description>
		<content:encoded><![CDATA[<p>I think run simply returns the process return values in this way:</p>
<p>return ($result == 0 ?? $result but True !! $result but False);</p>
<p>Thus returning a zero which tests true, or a nonzero which tests false.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Christopher Osborn</title>
		<link>http://perl6advent.wordpress.com/2010/12/19/day-19-false-truth/#comment-579</link>
		<dc:creator><![CDATA[Christopher Osborn]]></dc:creator>
		<pubDate>Sun, 19 Dec 2010 07:29:18 +0000</pubDate>
		<guid isPermaLink="false">http://perl6advent.wordpress.com/?p=675#comment-579</guid>
		<description><![CDATA[I can&#039;t imagine the example method shown is the one used for the overloaded &amp;run, for the reason you state.  However, I think it would be done similarly to this…

return $exit_code but role { method Bool { $_ == 0 } }; # or perhaps !$_

…though I&#039;m sure they use a predefined type.
(Code not guaranteed to be accurate, but I hope you get the idea.)]]></description>
		<content:encoded><![CDATA[<p>I can&#8217;t imagine the example method shown is the one used for the overloaded &amp;run, for the reason you state.  However, I think it would be done similarly to this…</p>
<p>return $exit_code but role { method Bool { $_ == 0 } }; # or perhaps !$_</p>
<p>…though I&#8217;m sure they use a predefined type.<br />
(Code not guaranteed to be accurate, but I hope you get the idea.)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan J.</title>
		<link>http://perl6advent.wordpress.com/2010/12/19/day-19-false-truth/#comment-572</link>
		<dc:creator><![CDATA[Dan J.]]></dc:creator>
		<pubDate>Sun, 19 Dec 2010 03:20:27 +0000</pubDate>
		<guid isPermaLink="false">http://perl6advent.wordpress.com/?p=675#comment-572</guid>
		<description><![CDATA[I&#039;m confused on one issue.  You say &quot;Normally, for Ints, the .Bool method (and therefore the prefix: operator) returns whether the number is non-zero, but here we make it always return False.&quot;

Does it ALWAYS return False?  If so, how does the overloaded &amp;run work?  How do you specify the conditions on when it returns True and when it returns False?  Specifying when something returns True or False is a very useful feature.  Having it ALWAYS return one specific value would be much less so, since there would be no need to every check it&#039;s return value.]]></description>
		<content:encoded><![CDATA[<p>I&#8217;m confused on one issue.  You say &#8220;Normally, for Ints, the .Bool method (and therefore the prefix: operator) returns whether the number is non-zero, but here we make it always return False.&#8221;</p>
<p>Does it ALWAYS return False?  If so, how does the overloaded &amp;run work?  How do you specify the conditions on when it returns True and when it returns False?  Specifying when something returns True or False is a very useful feature.  Having it ALWAYS return one specific value would be much less so, since there would be no need to every check it&#8217;s return value.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
