<?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: Traits &#8212; Meta Data With Character</title>
	<atom:link href="http://perl6advent.wordpress.com/2011/12/04/traits-meta-data-with-character/feed/" rel="self" type="application/rss+xml" />
	<link>http://perl6advent.wordpress.com/2011/12/04/traits-meta-data-with-character/</link>
	<description>Something cool about Perl 6 every day</description>
	<lastBuildDate>Wed, 05 Jun 2013 15:41:30 +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/2011/12/04/traits-meta-data-with-character/#comment-940</link>
		<dc:creator><![CDATA[Moritz]]></dc:creator>
		<pubDate>Tue, 06 Dec 2011 09:17:13 +0000</pubDate>
		<guid isPermaLink="false">http://perl6advent.wordpress.com/?p=778#comment-940</guid>
		<description><![CDATA[Yes, you are off base.

.WHICH is indeed used for hashing and comparison, but not the same kind of comparison that &lt;code&gt;is cached&lt;/code&gt; needs. It does object identity comparsion (like the === operator), but caching needs object equivalence comparsion (like the eqv operator). Only for value types are the two comparison semantics the same.

Each call to a subroutine creates a new Capture object, so comparison with .WHICH and hashing will never find a match.]]></description>
		<content:encoded><![CDATA[<p>Yes, you are off base.</p>
<p>.WHICH is indeed used for hashing and comparison, but not the same kind of comparison that <code>is cached</code> needs. It does object identity comparsion (like the === operator), but caching needs object equivalence comparsion (like the eqv operator). Only for value types are the two comparison semantics the same.</p>
<p>Each call to a subroutine creates a new Capture object, so comparison with .WHICH and hashing will never find a match.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: raiph</title>
		<link>http://perl6advent.wordpress.com/2011/12/04/traits-meta-data-with-character/#comment-934</link>
		<dc:creator><![CDATA[raiph]]></dc:creator>
		<pubDate>Mon, 05 Dec 2011 15:36:49 +0000</pubDate>
		<guid isPermaLink="false">http://perl6advent.wordpress.com/?p=778#comment-934</guid>
		<description><![CDATA[Hi Moritz,

&quot;captures are no value types, so you can’t use .WHICH for hashing and comparing&quot;

I realize captures aren&#039;t value types. But it totally doesn&#039;t yet follow for me that you shouldn&#039;t (let alone can&#039;t) expect to use WHICH for hashing and comparing.

Reread the paragraph I quoted below from: http://perlcabal.org/syn/S02.html#The_.WHICH_Method_for_Value_Types

Maybe I haven&#039;t had enough coffee, or maybe the spec is wrong, misleading, or overly ambitious, but my simple read of it this is that:
A) WHICH is intended for hashing and comparing of objects ...
B) ... that are often not value types, and that ...
C) ... the capture class could &quot;define a .WHICH method that makes different [captures] look like the same object if they happen to have the same contents.&quot;

I was imagining a capture would walk the tree of objects it contains, collecting WHICHs. If any object doesn&#039;t return a WHICH value, the walk ends and the capture fails to cache. If any object returns an ObjAt which ignores the &quot;same content&quot; issue, then the capture, if cached, ends up taking space in the cache but never matches.

Am I off base?]]></description>
		<content:encoded><![CDATA[<p>Hi Moritz,</p>
<p>&#8220;captures are no value types, so you can’t use .WHICH for hashing and comparing&#8221;</p>
<p>I realize captures aren&#8217;t value types. But it totally doesn&#8217;t yet follow for me that you shouldn&#8217;t (let alone can&#8217;t) expect to use WHICH for hashing and comparing.</p>
<p>Reread the paragraph I quoted below from: <a href="http://perlcabal.org/syn/S02.html#The_.WHICH_Method_for_Value_Types" rel="nofollow">http://perlcabal.org/syn/S02.html#The_.WHICH_Method_for_Value_Types</a></p>
<p>Maybe I haven&#8217;t had enough coffee, or maybe the spec is wrong, misleading, or overly ambitious, but my simple read of it this is that:<br />
A) WHICH is intended for hashing and comparing of objects &#8230;<br />
B) &#8230; that are often not value types, and that &#8230;<br />
C) &#8230; the capture class could &#8220;define a .WHICH method that makes different [captures] look like the same object if they happen to have the same contents.&#8221;</p>
<p>I was imagining a capture would walk the tree of objects it contains, collecting WHICHs. If any object doesn&#8217;t return a WHICH value, the walk ends and the capture fails to cache. If any object returns an ObjAt which ignores the &#8220;same content&#8221; issue, then the capture, if cached, ends up taking space in the cache but never matches.</p>
<p>Am I off base?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Moritz</title>
		<link>http://perl6advent.wordpress.com/2011/12/04/traits-meta-data-with-character/#comment-929</link>
		<dc:creator><![CDATA[Moritz]]></dc:creator>
		<pubDate>Mon, 05 Dec 2011 09:16:13 +0000</pubDate>
		<guid isPermaLink="false">http://perl6advent.wordpress.com/?p=778#comment-929</guid>
		<description><![CDATA[Note that captures are no value types, so you can&#039;t use .WHICH for hashing and comparing. So you have to come up with something more clever.]]></description>
		<content:encoded><![CDATA[<p>Note that captures are no value types, so you can&#8217;t use .WHICH for hashing and comparing. So you have to come up with something more clever.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: raiph</title>
		<link>http://perl6advent.wordpress.com/2011/12/04/traits-meta-data-with-character/#comment-928</link>
		<dc:creator><![CDATA[raiph]]></dc:creator>
		<pubDate>Sun, 04 Dec 2011 21:10:39 +0000</pubDate>
		<guid isPermaLink="false">http://perl6advent.wordpress.com/?p=778#comment-928</guid>
		<description><![CDATA[&gt; I’m not sure how well WHICH works in general yet…

Right. I decided not to mention that &quot;implementation detail&quot;.

&gt; I don’t think that second part really works, because every capture will be a unique object.

I wondered about that.

http://perlcabal.org/syn/S02.html#The_.WHICH_Method_for_Value_Types says
&quot;Every object can produce a &quot;WHICH&quot; value that uniquely identifies the object for hashing and other value-based comparisons. Normal objects just use their location as their identity, but if a class wishes to behave as a value type, it can define a .WHICH method that makes different objects look like the same object if they happen to have the same contents.&quot;]]></description>
		<content:encoded><![CDATA[<p>&gt; I’m not sure how well WHICH works in general yet…</p>
<p>Right. I decided not to mention that &#8220;implementation detail&#8221;.</p>
<p>&gt; I don’t think that second part really works, because every capture will be a unique object.</p>
<p>I wondered about that.</p>
<p><a href="http://perlcabal.org/syn/S02.html#The_.WHICH_Method_for_Value_Types" rel="nofollow">http://perlcabal.org/syn/S02.html#The_.WHICH_Method_for_Value_Types</a> says<br />
&#8220;Every object can produce a &#8220;WHICH&#8221; value that uniquely identifies the object for hashing and other value-based comparisons. Normal objects just use their location as their identity, but if a class wishes to behave as a value type, it can define a .WHICH method that makes different objects look like the same object if they happen to have the same contents.&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: colomon</title>
		<link>http://perl6advent.wordpress.com/2011/12/04/traits-meta-data-with-character/#comment-927</link>
		<dc:creator><![CDATA[colomon]]></dc:creator>
		<pubDate>Sun, 04 Dec 2011 16:52:48 +0000</pubDate>
		<guid isPermaLink="false">http://perl6advent.wordpress.com/?p=778#comment-927</guid>
		<description><![CDATA[I don&#039;t think that second part really works, because every capture will be a unique object.

And I&#039;m not sure how well WHICH works in general yet...]]></description>
		<content:encoded><![CDATA[<p>I don&#8217;t think that second part really works, because every capture will be a unique object.</p>
<p>And I&#8217;m not sure how well WHICH works in general yet&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: raiph</title>
		<link>http://perl6advent.wordpress.com/2011/12/04/traits-meta-data-with-character/#comment-926</link>
		<dc:creator><![CDATA[raiph]]></dc:creator>
		<pubDate>Sun, 04 Dec 2011 16:35:15 +0000</pubDate>
		<guid isPermaLink="false">http://perl6advent.wordpress.com/?p=778#comment-926</guid>
		<description><![CDATA[AIA if this formats badly and I can&#039;t edit it...

&quot;Note that a production grade is cached would need to handle multiple arguments&quot;

----

I&#039;ll bite. I&#039;d be delighted to get comments.

A1) Parameter list that handles zero or more args
A2) Cache indexing corresponding to zero or more args

----

A1) Parameter list that handles zero or more args

From https://raw.github.com/perl6/specs/master/S08-capture.pod:
&quot;the data structure that is used to send the parameters into a routine invocation (be it a method or a sub) is exposed to the language as a built-in type like any other.&quot;

So:
     $r.wrap(-&gt; ¢args {
?

A2) Cache indexing corresponding to zero or more args

From https://raw.github.com/perl6/specs/master/S02-bits.pod:
&quot;Every object can produce a &quot;WHICH&quot; value that uniquely identifies the object for hashing and other value-based comparisons.&quot;

So:
     $r.wrap(-&gt; ¢args {
         my $key = ¢args.WHICH
         %cache.exists($key)
?]]></description>
		<content:encoded><![CDATA[<p>AIA if this formats badly and I can&#8217;t edit it&#8230;</p>
<p>&#8220;Note that a production grade is cached would need to handle multiple arguments&#8221;</p>
<p>&#8212;-</p>
<p>I&#8217;ll bite. I&#8217;d be delighted to get comments.</p>
<p>A1) Parameter list that handles zero or more args<br />
A2) Cache indexing corresponding to zero or more args</p>
<p>&#8212;-</p>
<p>A1) Parameter list that handles zero or more args</p>
<p>From <a href="https://raw.github.com/perl6/specs/master/S08-capture.pod" rel="nofollow">https://raw.github.com/perl6/specs/master/S08-capture.pod</a>:<br />
&#8220;the data structure that is used to send the parameters into a routine invocation (be it a method or a sub) is exposed to the language as a built-in type like any other.&#8221;</p>
<p>So:<br />
     $r.wrap(-&gt; ¢args {<br />
?</p>
<p>A2) Cache indexing corresponding to zero or more args</p>
<p>From <a href="https://raw.github.com/perl6/specs/master/S02-bits.pod" rel="nofollow">https://raw.github.com/perl6/specs/master/S02-bits.pod</a>:<br />
&#8220;Every object can produce a &#8220;WHICH&#8221; value that uniquely identifies the object for hashing and other value-based comparisons.&#8221;</p>
<p>So:<br />
     $r.wrap(-&gt; ¢args {<br />
         my $key = ¢args.WHICH<br />
         %cache.exists($key)<br />
?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
