<?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/"
		>
<channel>
	<title>Comments on: Foiled by Erasure!</title>
	<atom:link href="http://stuffthathappens.com/blog/2007/11/04/foiled-by-erasure/feed/" rel="self" type="application/rss+xml" />
	<link>http://stuffthathappens.com/blog/2007/11/04/foiled-by-erasure/</link>
	<description>Technology and Geek Stuff by Eric Burke</description>
	<lastBuildDate>Mon, 26 Jul 2010 14:36:32 -0400</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Ricky Clarkson</title>
		<link>http://stuffthathappens.com/blog/2007/11/04/foiled-by-erasure/comment-page-1/#comment-980</link>
		<dc:creator>Ricky Clarkson</dc:creator>
		<pubDate>Mon, 05 Nov 2007 21:09:50 +0000</pubDate>
		<guid isPermaLink="false">http://stuffthathappens.com/blog/2007/11/04/foiled-by-erasure/#comment-980</guid>
		<description>Erasure itself isn&#039;t really a bad thing; Haskell erases types but doesn&#039;t have this kind of problem.  You can still do type-based dispatch in Haskell, but at compile-time (typeclasses).  Scala appears to exhibit the same problem as Java here, but has something equivalent to typeclasses - implicits, so you can still do most things you&#039;d like to be able to.

I suppose you could split MyBean up into the bean plus a couple of EventSubscribers.</description>
		<content:encoded><![CDATA[<p>Erasure itself isn&#8217;t really a bad thing; Haskell erases types but doesn&#8217;t have this kind of problem.  You can still do type-based dispatch in Haskell, but at compile-time (typeclasses).  Scala appears to exhibit the same problem as Java here, but has something equivalent to typeclasses &#8211; implicits, so you can still do most things you&#8217;d like to be able to.</p>
<p>I suppose you could split MyBean up into the bean plus a couple of EventSubscribers.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stephen Colebourne</title>
		<link>http://stuffthathappens.com/blog/2007/11/04/foiled-by-erasure/comment-page-1/#comment-961</link>
		<dc:creator>Stephen Colebourne</dc:creator>
		<pubDate>Mon, 05 Nov 2007 09:34:18 +0000</pubDate>
		<guid isPermaLink="false">http://stuffthathappens.com/blog/2007/11/04/foiled-by-erasure/#comment-961</guid>
		<description>The naive way for an improved compiler to handle this would be:

public void onEvent(Object event) {
. if (event instanceof String) {
. . onEvent((String) event);
. } else if (event instanceof StatusEvent ) {
. . onEvent((StatusEvent) event);
. } else {
. . throw new ClassCastException(&quot;Invalid use of generics&quot;);
. }
}

It would appear at first glance that this could be done without erasing erasure. The question is whether it would perform well enough for you?</description>
		<content:encoded><![CDATA[<p>The naive way for an improved compiler to handle this would be:</p>
<p>public void onEvent(Object event) {<br />
. if (event instanceof String) {<br />
. . onEvent((String) event);<br />
. } else if (event instanceof StatusEvent ) {<br />
. . onEvent((StatusEvent) event);<br />
. } else {<br />
. . throw new ClassCastException(&#8221;Invalid use of generics&#8221;);<br />
. }<br />
}</p>
<p>It would appear at first glance that this could be done without erasing erasure. The question is whether it would perform well enough for you?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bob Lee</title>
		<link>http://stuffthathappens.com/blog/2007/11/04/foiled-by-erasure/comment-page-1/#comment-954</link>
		<dc:creator>Bob Lee</dc:creator>
		<pubDate>Mon, 05 Nov 2007 05:33:48 +0000</pubDate>
		<guid isPermaLink="false">http://stuffthathappens.com/blog/2007/11/04/foiled-by-erasure/#comment-954</guid>
		<description>I think this might be more indirectly related to erasure. I mean, method calls are bound at compile time. You have all the type information you need for this to work. Actually, you have all the information you&#039;d need at runtime, too. I&#039;ll bet the real problem is that calls to the methods with raw types would be ambiguous.</description>
		<content:encoded><![CDATA[<p>I think this might be more indirectly related to erasure. I mean, method calls are bound at compile time. You have all the type information you need for this to work. Actually, you have all the information you&#8217;d need at runtime, too. I&#8217;ll bet the real problem is that calls to the methods with raw types would be ambiguous.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.941 seconds -->
