<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.2.3" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>
<channel>
	<title>Comments on: Modules Part I - Enter the Include Class</title>
	<link>http://www.klankboomklang.com/2007/11/25/modules-part-i-enter-the-include-class/</link>
	<description>Ruby and otherwise by Patrick Farley</description>
	<pubDate>Wed, 08 Sep 2010 21:07:27 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.3</generator>

	<item>
		<title>By: Daniel Berger</title>
		<link>http://www.klankboomklang.com/2007/11/25/modules-part-i-enter-the-include-class/#comment-231</link>
		<dc:creator>Daniel Berger</dc:creator>
		<pubDate>Mon, 17 Dec 2007 19:55:06 +0000</pubDate>
		<guid>http://www.klankboomklang.com/2007/11/25/modules-part-i-enter-the-include-class/#comment-231</guid>
		<description>Along the same lines, what are your thoughts on selector namespaces? They could be added in Ruby to allow the user to select the inheritence hierarchy, couldn't they?

I wrote a post about them a while back if you're interested:

http://djberg96.livejournal.com/50830.html</description>
		<content:encoded><![CDATA[<p>Along the same lines, what are your thoughts on selector namespaces? They could be added in Ruby to allow the user to select the inheritence hierarchy, couldn&#8217;t they?</p>
<p>I wrote a post about them a while back if you&#8217;re interested:</p>
<p><a href="http://djberg96.livejournal.com/50830.html" rel="nofollow">http://djberg96.livejournal.com/50830.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel Berger</title>
		<link>http://www.klankboomklang.com/2007/11/25/modules-part-i-enter-the-include-class/#comment-230</link>
		<dc:creator>Daniel Berger</dc:creator>
		<pubDate>Mon, 17 Dec 2007 19:29:28 +0000</pubDate>
		<guid>http://www.klankboomklang.com/2007/11/25/modules-part-i-enter-the-include-class/#comment-230</guid>
		<description>Oh, no. We're not headed towards a discussion on Traits, are we? ;)

BTW, minor typo. You've got a double "is" at "This reference to the actual module is is useful for the case"</description>
		<content:encoded><![CDATA[<p>Oh, no. We&#8217;re not headed towards a discussion on Traits, are we? ;)</p>
<p>BTW, minor typo. You&#8217;ve got a double &#8220;is&#8221; at &#8220;This reference to the actual module is is useful for the case&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pfarley</title>
		<link>http://www.klankboomklang.com/2007/11/25/modules-part-i-enter-the-include-class/#comment-177</link>
		<dc:creator>pfarley</dc:creator>
		<pubDate>Mon, 26 Nov 2007 12:43:56 +0000</pubDate>
		<guid>http://www.klankboomklang.com/2007/11/25/modules-part-i-enter-the-include-class/#comment-177</guid>
		<description>Hi Bill,

You are correct in assuming that method dispatch will find the method it's looking for in the last module mixed in.  There is no name collision problem as the methods are not stored in the same place, they are keys on different m_tbls.  Since the method is found in the m_tbl of the latter module, the interpreter does not follow the super chain to check the m_tbl of the first module.

This behavior is more or less identical to an overridden instance method in a subclass.  One of the things I'm hoping to get across in this and the following post is that mixins, positive press notwithstanding, are a form of inheritance, albeit a very dynamic  one.   That means that they are prey to some of the problems of deep and complex inheritance structures.

Thanks for the comment and for reading.</description>
		<content:encoded><![CDATA[<p>Hi Bill,</p>
<p>You are correct in assuming that method dispatch will find the method it&#8217;s looking for in the last module mixed in.  There is no name collision problem as the methods are not stored in the same place, they are keys on different m_tbls.  Since the method is found in the m_tbl of the latter module, the interpreter does not follow the super chain to check the m_tbl of the first module.</p>
<p>This behavior is more or less identical to an overridden instance method in a subclass.  One of the things I&#8217;m hoping to get across in this and the following post is that mixins, positive press notwithstanding, are a form of inheritance, albeit a very dynamic  one.   That means that they are prey to some of the problems of deep and complex inheritance structures.</p>
<p>Thanks for the comment and for reading.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bill Six</title>
		<link>http://www.klankboomklang.com/2007/11/25/modules-part-i-enter-the-include-class/#comment-176</link>
		<dc:creator>Bill Six</dc:creator>
		<pubDate>Mon, 26 Nov 2007 07:06:38 +0000</pubDate>
		<guid>http://www.klankboomklang.com/2007/11/25/modules-part-i-enter-the-include-class/#comment-176</guid>
		<description>I'm relatively new to Ruby, so sorry if this question is trivial.

What happens if two modules both provide a definition for method with the same name?  Since they are mixed-in in a linear order, I would assume that the first one found is invoked.  I would also assume that, if this were a problem, the methods in each mixin would be prefixed by something unique (like the module name) to avoid the method-name clash.

If my understanding of mixins is correct; do people find this a problem in practice?</description>
		<content:encoded><![CDATA[<p>I&#8217;m relatively new to Ruby, so sorry if this question is trivial.</p>
<p>What happens if two modules both provide a definition for method with the same name?  Since they are mixed-in in a linear order, I would assume that the first one found is invoked.  I would also assume that, if this were a problem, the methods in each mixin would be prefixed by something unique (like the module name) to avoid the method-name clash.</p>
<p>If my understanding of mixins is correct; do people find this a problem in practice?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
