-
Notifications
You must be signed in to change notification settings - Fork 2k
super.apply(…) does not work as might be expected #3004
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
Comments
@Nami-Doc that is not at all the case. That still applies the super-implementation to (This is my own fault for using |
Then I'd say |
@Nami-Doc still doesn't have bearing on the original issue; and to boot, that's hard-coding the Parent into the body of the function, which the point is to avoid. Point of this issue is (and please re-open it), that it's unintuitive for |
This has already been answered in the issue I linked before.
|
@Nami-Doc … no, it's not. @jashkenas talks about:
… both of which I agree with. The original point, and the one I'm alluding to here, is more clearly made by @michaelficarra:
The point here is that, with
… as well as calling methods of
|
Yeah, i totally agree with @ELLIOTTCABLE and @michaelficarra in that That being said, you can call class Foo
bar: ->
args = ['hello', 'world']
# return Foo.__super__.bar.apply(this, args);
super args... |
Also see #2638, which seems to be what you want |
@epidemian that's only applicable if you want to apply the superclass to the current |
@ELLIOTTCABLE Can you share the actual code from your actual use case here? I'd be curious to see. |
@jashkenas The thought-process that promoted this post is no longer relevant, as I have my The code in question, as it would have looked before the refactor of (Unrelated: @jashkenas, I admire your free-spirited nature, and the decision to take the trip you're documenting. Live life to the fullest. <3) |
If you're used to Java, perhaps yes. If you're used to Ruby, perhaps no. I can't think of many use cases where you'd ever want to be calling The (debatable) reason why
Instead of this:
... and thanks for the good cheer. Just walked back from military singing, dancing, and fireworks in the Ulaanbaatar town square. |
Agreed on all points, with one very important caveat: I was, and this may not have been clear, suggesting that Does that make a little sense? Of course |
Not "intuitive" to me, I'm afraid. If I see If I see |
hm. What about |
|
This seems, to me, very unintuitive:
I'd (hopefully, obviously) expect the following:
Sure, I can do it manually …
… but still, this seems so unintuitive and ugly.
The text was updated successfully, but these errors were encountered: