Virtual Extension By Inversion of Responsibility (Second Draft)

Collin Fagan collin.fagan at gmail.com
Fri Jun 18 07:00:54 PDT 2010


Neal,

I agree keywords would be more elegant. For that matter replacing ->
with a . would be even more elegant, if possible. I'll work that into
a third draft. The first ones that come to mind are:

@ExtensionSupport changes to supports

@ExtensionTarget changes to targets

Thanks again for your time,

Collin

On Thu, Jun 17, 2010 at 11:39 PM, Neal Gafter <neal at gafter.com> wrote:
> Colin-
>
> I like some aspects of this proposal.  Compared to defender methods,
> there is no need for a special InterfaceName.super.method(...)
> notation.  I like that it can be used to extend interfaces over which
> the programmer does not have control: that enables pattern-based
> frameworks and language extensions to be more generally useful (ala
> LINQ).  An example of where that would be useful today is in the
> specification of ARM blocks; if defined in terms of -> instead of .,
> it can be retrofitted to many more types than would otherwise be
> possible.  Defender methods don't allow that.
>
> I don't like the use of annotations (@ExtensionSupport and
> @ExtensionTarget) to change the meaning of declarations; this could be
> done with context-sensitive keywords instead.  It is a little
> unfortunate that the syntax is distractingly different from an
> ordinary method invocation, even though the reader usually doesn't
> care (now we'd have three different invocation syntax forms).
>
> Cheers,
> Neal
>
> On Thu, Jun 17, 2010 at 8:09 PM, Collin Fagan <collin.fagan at gmail.com> wrote:
>> Hi Everyone,
>>
>> I've put together a second draft of my proposal for virtual extension
>> methods.
>>
>> http://www.box.net/shared/r24vvgma5p
>>
>> And yes *this* time they are really virtual. I welcome all comments.
>>
>> Thanks,
>>
>> Collin
>>
>>
>


More information about the lambda-dev mailing list