<?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>2010-12-09T14:22:40.603-02:00</updated><category term='linux'/><category term='ENTP'/><category term='sysadmin'/><category term='CDATA'/><category term='javascript'/><category term='ajax'/><category term='mocha'/><category term='Design'/><category term='Functional programming'/><category term='reverse ajax'/><category term='Metaprogramming'/><category term='Refactoring'/><category term='Testing'/><category term='C#'/><category term='Duck typing'/><category term='ssh git capistrano'/><category term='comet'/><category term='Ruby Cubox'/><category term='RSpec'/><category term='Xml'/><category term='Ruby'/><category term='plugin'/><category term='BDD'/><category term='DSL'/><category term='Linq'/><category term='rails'/><category term='mongrel'/><category term='Humor'/><category term='vim'/><category term='Autotest'/><category term='prototype'/><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><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://lh3.google.es/dcadenas/Ra-_PqMllUI/AAAAAAAAAAw/-221g8_4dkc/594183122.jpg'/></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.&lt;br&gt;&lt;br&gt;My mistake comes from implici...</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:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://lh3.google.es/dcadenas/Ra-_PqMllUI/AAAAAAAAAAw/-221g8_4dkc/594183122.jpg'/></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'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1964916130'/></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'>&amp;gt; puts a.foo #=&amp;gt; A#foo (and not X#foo!!!!!!!...</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><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></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'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1713155394'/></entry></feed>
