--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">&lt;dblack / rubypal.com&gt;</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 &lt;<a href="mailto:vjoel / path.berkeley.edu" target="_blank">vjoel / path.berkeley.edu</a>&gt;<br>
wrote:<br>
   庼
   
   prepend Exclaimer<br>
  
<br>
<br>
Is there some way to make the relationship more visually obvious?<br>
<br>
class Person &gt; 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&#39;m not sure about the<br>
name. The problem, for me, is that it&#39;s *too* array-like. The other<br>
related operations don&#39;t have that same spatial/collection feel to<br>
them. Somehow prepend doesn&#39;t sound like it&#39;s in the same semantic<br>
space as include.<br>
<br>
Now I&#39;m supposed to pony up a brilliant alternative :-) include! came<br>
to mind. The &quot;dangerous&quot; aspect is that it occludes the current<br>
version of the method.<br>
<br>
  ͼ     
  
<br>
   ü     
<br>
         󦣳   
<br>
Mind you, I&#39;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&#39;m not sure about &quot;prepend&quot;.<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--