-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make super
consistent with ES6
#2638
Comments
+1. |
I'm afraid we're not targeting ES6 yet -- and at the time that CoffeeScript's More importantly than that, I think our semantics are desirable. I think that languages that allow you to write:
... are violating encapsulation. Your method implementation shouldn't have to know where in the inheritance hierarchy you need to call. |
actually I agree with jash’s args, almost never called other superclass methods in apps. But almost always calling |
what about allowing |
@Nami-Doc |
Seems overly ugly to me, doesn't it? |
Just name the external class -- like you usually would. |
I suppose that's the best way |
One of the problems of implicit delegation: Default values for parameters don't work. I guess this could be fixed in Redux. |
Would be great if this were true. In reality it isn't that simple due to the implicit |
I don't know if it helps with CoffeeScripts eventual push to incorporate ES6 features once it's ratified (later this year?), but it seems CoffeeScript's super wouldn't need a change at all (at best minor): |
super
calls appropriate fn of the superclass with allarguments
andsuper a, b, c
for calling with other args.super
is just a direct reference to the super class.super
is just a direct reference to the super function.I’m in favour of ES6-way which will be consistent with futurejs.
So,
super
should just be a ref to superclass. This will also allow to use it in static methods etc which will close gh-1790The text was updated successfully, but these errors were encountered: