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:
>> =A0 =A0 =A0Yehuda Katz wrote:
>> =A0 =A0 =A0 =A0 =A0 =A0class Person
>> =A0 =A0 =A0 =A0 =A0 =A0=A0prepend Exclaimer
>> =A0 =A0 =A0 =A0 =A0 =A0end
>>
>>
>> Is there some way to make the relationship more visually obvious?
>>
>> class Person > Exclaimer
>> end
>>
>> class Person
>> =A0self >> Exclaimer
>> end
>>
>>
>> Hmmm... seems potentially=A0a bit=A0visually 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.
>
> =A0module M
> =A0 =A0def x
> =A0 =A0end
> =A0end
>
> =A0class C
> =A0 =A0def x
> =A0 =A0end
>
> =A0 =A0include M =A0 =A0 =A0 # doesn't affect instances
> =A0 =A0include! M =A0 =A0 =A0# blocks this class's same-named methods
> =A0end
>
> 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".


Include is gravy around append_features, so prepend_features feels
natural to me.

Also intriguing (and tangential) would be allowing
ancestors.unshift/push directly.

jeremy