Extension vs defender methods

Neal Gafter neal at gafter.com
Wed Nov 9 12:04:21 PST 2011


On Wed, Nov 9, 2011 at 9:11 AM, Brian Goetz <brian.goetz at oracle.com> wrote:

> Slight correction on the terminology front, both are 'extension' methods.
>  There are a few axes of choice -- use-site vs declaration-site, virtual vs
> static.
>

The meaning of *extension* in the phrase *extension methods* is that they
allow functionality to be added (i.e. extend) to a type that was not
provided by the author of the type.  I don't know in what sense you're
using the term *extension* in the proposed defender methods - perhaps it
has something to do with versioning?  But of course, being an adjective you
can make it mean whatever you want ;-)

    “I don’t know what you mean by ‘extension,’ ” Alice said.
    Humpty Dumpty smiled contemptuously. “Of course you don’t—till I tell
you. I meant ‘there’s a nice knock-down argument for you!’ ”
    “But ‘extension’ doesn’t mean ‘a nice knock-down argument’,” Alice
objected.
    “When *I* use a word,” Humpty Dumpty said, in rather a scornful tone,
“it means just what I choose it to mean—neither more nor less.”
    “The question is,” said Alice, “whether you *can* make words mean so
many different things.”
    “The question is,” said Humpty Dumpty, “which is to be master      that’s
all.”
    Alice was too much puzzled to say anything, so after a minute Humpty
Dumpty began again. “They’ve a temper, some of them—particularly verbs,
they’re the proudest—adjectives you can do anything with, but not
verbs—however, *I* can manage the whole lot! Impenetrability! That’s what *I
* say!”[14] <http://en.wikipedia.org/wiki/Humpty_Dumpty#cite_note-13>


More information about the lambda-dev mailing list