<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'><id>tag:blogger.com,1999:blog-3836263610079655093.post5615504025510289287..comments</id><updated>2008-10-07T11:51:36.922-02:00</updated><title type='text'>Comments on Daniel Cadenas: One thing to keep in mind when extending Ruby clas...</title><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://www.danielcadenas.com/feeds/5615504025510289287/comments/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3836263610079655093/5615504025510289287/comments/default'/><link rel='alternate' type='text/html' href='http://www.danielcadenas.com/2008/10/quirk-to-keep-in-mind-when-extending.html'/><author><name>Daniel Cadenas</name><uri>http://www.blogger.com/profile/07935636187234627682</uri><email>noreply@blogger.com</email></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>2</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3836263610079655093.post-3544923765826663590</id><published>2008-10-07T11:51:00.000-02:00</published><updated>2008-10-07T11:51:00.000-02:00</updated><title type='text'>That's right.My mistake comes from implicitely thi...</title><content type='html'>That's right.&lt;BR/&gt;&lt;BR/&gt;My mistake comes from implicitely thinking that include or extend where not much than this:&lt;BR/&gt;&lt;BR/&gt;ancestor_chain.add(module)&lt;BR/&gt;&lt;BR/&gt;So it seems they are not as dumb and it's not possible to do weird things like [X, X, X, Object]. They don't just follow orders.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3836263610079655093/5615504025510289287/comments/default/3544923765826663590'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3836263610079655093/5615504025510289287/comments/default/3544923765826663590'/><link rel='alternate' type='text/html' href='http://www.danielcadenas.com/2008/10/quirk-to-keep-in-mind-when-extending.html?showComment=1223387460000#c3544923765826663590' title=''/><author><name>Daniel Cadenas</name><uri>http://www.blogger.com/profile/07935636187234627682</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='01768789512016709947'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.danielcadenas.com/2008/10/quirk-to-keep-in-mind-when-extending.html' ref='tag:blogger.com,1999:blog-3836263610079655093.post-5615504025510289287' source='http://www.blogger.com/feeds/3836263610079655093/posts/default/5615504025510289287' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-3836263610079655093.post-4665476967199158447</id><published>2008-10-07T01:07:00.000-02:00</published><updated>2008-10-07T01:07:00.000-02:00</updated><title type='text'>&gt; puts a.foo #=&gt; A#foo (and not X#foo!!!!!!!)Calli...</title><content type='html'>&amp;gt; puts a.foo #=&amp;gt; A#foo (and not X#foo!!!!!!!)&lt;BR/&gt;&lt;BR/&gt;Calling .ancestors should have given you a hint but to quote Programming Ruby &amp;quot;mixed-in modules effectively behave as superclasses&amp;quot;. If you changed your &amp;#39;foo&amp;#39; method definition to:&lt;BR/&gt;&lt;BR/&gt;def foo&lt;BR/&gt;  super rescue &amp;quot;A#foo&amp;quot;&lt;BR/&gt;end&lt;BR/&gt;&lt;BR/&gt;You&amp;#39;ll see X#foo as you expect after mixing in X.&lt;BR/&gt;&lt;BR/&gt;This also may help explain why Ruby ignores your a.extend X since X is already mixed in and behaving as a superclass.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3836263610079655093/5615504025510289287/comments/default/4665476967199158447'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3836263610079655093/5615504025510289287/comments/default/4665476967199158447'/><link rel='alternate' type='text/html' href='http://www.danielcadenas.com/2008/10/quirk-to-keep-in-mind-when-extending.html?showComment=1223348820000#c4665476967199158447' title=''/><author><name>Anonymous</name><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.danielcadenas.com/2008/10/quirk-to-keep-in-mind-when-extending.html' ref='tag:blogger.com,1999:blog-3836263610079655093.post-5615504025510289287' source='http://www.blogger.com/feeds/3836263610079655093/posts/default/5615504025510289287' type='text/html'/></entry></feed>