-
Notifications
You must be signed in to change notification settings - Fork 191
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
Document that @name is a method call if self.name is a function #436
Comments
There is a small snippet in the documentation that kind of alludes to this, but is definitely not clear enough:
I would definitely welcome (as a user) a clarification on the docs. Perhaps it could be PR'd. Regardless, I'm pretty sure that it is expected behavior that |
Thanks for your input Apart from having to decide whether to eyeball through ~600 lines of code to insert dots in sundry places or to wrap some non-method functions adopted from other libraries in methods I can live with it even though IMO it is an inconsistency (and I'll probably keep writing self-method calls as |
How it works is intentional.
Since both of these operations are the most common uses of self, they are made easily accessible with the |
I realize that it is intentional, but I still think the docs should explain it explicitly. I have taken to always using the explicit |
Please consider these three expressions:
@\foo bar, @baz
@foo bar, @baz
@.foo bar, @baz
Currently 1 and 2 both compile into
self:foo(bar, self.baz)
while 3 compiles into
self.foo(bar, self.baz)
with 2 interpreted as a method call, which I find rather confusing. I did rather expect 2 to be interpreted like 3, especially since non-calling context
@baz
compiles toself.baz
in all cases!I'm not sure that this is a bug (I have not found it in the documentation) but it seems inconsistent.
The text was updated successfully, but these errors were encountered: