--000feaf0b19a1d7fe40472729039 Content-Type: text/plain; charset=ISO-8859-1 On Mon, Aug 31, 2009 at 4:09 AM, David A. Black <dblack / rubypal.com> wrote: > Hi -- > > On Mon, 31 Aug 2009, Yehuda Katz wrote: > > >> >> On Sun, Aug 30, 2009 at 10:09 PM, Joel VanderWerf < >> vjoel / path.berkeley.edu> >> 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". > We asked Matz about that, and he felt it was a bit *too* much. One major problem is that it would affect classes and not just modules, with more dubious semantics. > > > 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. -- Yehuda Katz Developer | Engine Yard (ph) 718.877.1325 --000feaf0b19a1d7fe40472729039 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable <br><br><div class="gmail_quote">On Mon, Aug 31, 2009 at 4:09 AM, David A. Black <span dir="ltr"><dblack / rubypal.com></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"> Hi --<div class="im"><br> <br> On Mon, 31 Aug 2009, Yehuda Katz wrote:<br> <br> <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> <br> <br> On Sun, Aug 30, 2009 at 10:09 PM, Joel VanderWerf <<a href="mailto:vjoel / path.berkeley.edu" target="_blank">vjoel / path.berkeley.edu</a>><br> wrote:<br> ¨ÂåèõäËáôú ÷òïô庼âò¾ ¨Âìáóó Ðåòóïî¼âò¾ prepend Exclaimer<br> ¨Âîä¼âò¾ <br> <br> Is there some way to make the relationship more visually obvious?<br> <br> class Person > Exclaimer<br> end<br> <br> class Person<br> ¨Âåì¦çô»¦çô» Åøãìáéíåò¼âòend<br> <br> <br> Hmmm... seems potentially ¨Â âé¤Â ¨Âéóõáììãïîæõóéîç® É¦£³¹»èáðð÷éôè ðòåðåî䬼âò¾ in particular if we also make prepend a method on Array.<br> </blockquote> <br></div> I like the idea of the reverse #include but I'm not sure about the<br> name. The problem, for me, is that it's *too* array-like. The other<br> related operations don't have that same spatial/collection feel to<br> them. Somehow prepend doesn't sound like it's in the same semantic<br> space as include.<br> <br> Now I'm supposed to pony up a brilliant alternative :-) include! came<br> to mind. The "dangerous" aspect is that it occludes the current<br> version of the method.<br> <br> ¨Âïäõìͼâò ¨Âåæ ø¼âò ¨Âîä¼âò¾ ¨Âîä¼âò¾ <br> ¨Âìáóó üâò ¨Âåæ ø¼âò ¨Âîä¼âò¾ <br> ¨Âîãìõäå äïåó³¹»áææåãô éîóôáîãåó¼âò ¨Âîãìõäå âìïãëó ôèéó ãìáó󦣳¹»óáíåîáíåä íåôèïäó¼âò ¨Âîä¼âò¾ <br> Mind you, I've always been intrigued by the idea of ancestors being<br> a fully read-write array. But the current semantics of include are not<br> very array-like, so I'm not sure about "prepend".<br></blockquote><div><br></div><div>We asked Matz about that, and he felt it was a bittoo* much. One major problem is that it would affect classes and not justodules, with more dubious semantics.</div> <div>/div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"> <br> <br> David<br><font color="#888888"> <br> -- <br> David A. Black / Ruby Power and Light, LLC / <a href="http://www.rubypal.com" target="_blank">http://www.rubypal.com</a><br> Ruby/Rails training, mentoring, consulting, code-review<br> Latest book: The Well-Grounded Rubyist (<a href="http://www.manning.com/black2" target="_blank">http://www.manning.com/black2</a>)<br> <br> September Ruby training in NJ has been POSTPONED. Details to follow.</font></blockquote></div><br><br clear="all"><br>-- <br>Yehuda Katz<br>Developer | Engine Yard<br>(ph) 718.877.1325<br> --000feaf0b19a1d7fe40472729039--