From: "David A. Black" Date: 2009-08-31T20:09:16+09:00 Subject: [ruby-core:25216] Re: Module#prepend and Array#prepend This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --1926193751-1305583179-1251716927=:2348 Content-Type: TEXT/PLAIN; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8BIT Hi -- On Mon, 31 Aug 2009, Yehuda Katz wrote: > > > On Sun, Aug 30, 2009 at 10:09 PM, Joel VanderWerf > wrote: > Yehuda Katz wrote: > class Person > �prepend Exclaimer > end > > > Is there some way to make the relationship more visually obvious? > > class Person > Exclaimer > end > > class Person > �self >> Exclaimer > end > > > Hmmm... seems potentially�a bit�visually confusing. I'm happy with prepend, > in particular if we also make prepend a method on Array. I like the idea of the reverse #include but I'm not sure about the name. The problem, for me, is that it's *too* array-like. The other related operations don't have that same spatial/collection feel to them. Somehow prepend doesn't sound like it's in the same semantic space as include. Now I'm supposed to pony up a brilliant alternative :-) include! came to mind. The "dangerous" aspect is that it occludes the current version of the method. module M def x end end class C def x end include M # doesn't affect instances include! M # blocks this class's same-named methods end Mind you, I've always been intrigued by the idea of ancestors being a fully read-write array. But the current semantics of include are not very array-like, so I'm not sure about "prepend". David -- David A. Black / Ruby Power and Light, LLC / http://www.rubypal.com Ruby/Rails training, mentoring, consulting, code-review Latest book: The Well-Grounded Rubyist (http://www.manning.com/black2) September Ruby training in NJ has been POSTPONED. Details to follow. --1926193751-1305583179-1251716927=:2348--