Minimalist Classes

Axel Rauschmayer axel at rauschma.de
Tue Nov 1 13:25:09 PDT 2011


For the record: I do think Allen’s design is superior to what I’ve seen so far and it also most clearly reflects the semantics of |super| (apart from a non-starter dynamic solution). Sorry for the off-topic contributions, I liked the puzzle of finding an alternative.

> Nope -- I think that design isn't the correct semantics. super() exists to delegate back to parent implementations of *the current method*. When calling a different instance method the calls should always start back out at the bottom of the inheritance hierarchy -- not at whatever level you happened to be on at the time.
> 
> If you haven't overridden the other instance method, then everything will work as expected ... and if you *have* overridden it, you need that overridden implementation to be called, otherwise you're breaking all kinds of expectations about the behavior of your code.


FWIW: here is the code. https://gist.github.com/1331748

-- 
Dr. Axel Rauschmayer
axel at rauschma.de

home: rauschma.de
twitter: twitter.com/rauschma
blog: 2ality.com



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20111101/e4df887e/attachment.html>


More information about the es-discuss mailing list