Skip to content
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

Naming a receiver argument should not make fields and methods in scope #16

Closed
wants to merge 1 commit into from

Conversation

ntrel
Copy link
Contributor

@ntrel ntrel commented Mar 13, 2019

Sometimes the docs use the receiver argument's fields without the receiver name. I think this should be allowed but only when no name is given. When the receiver is named the programmer then need not think about name collisions which can be confusing. It also seems unnecessary to name the receiver if the fields/methods are not called through that name.

This change conflicts with my PR #13, but that will need updating anyway if this pull is accepted.

…cope

Sometimes the docs use the receiver argument's fields without the receiver name, I think this should be allowed but only when no name is given. This allows the programmer not to worry about name collisions (when the receiver is named) which can be confusing. It also seems unnecessary to name the receiver if the fields/methods are not called through that name.
@ntrel
Copy link
Contributor Author

ntrel commented Mar 14, 2019

Closing this because sometimes a name is needed, and when the programmer realizes this it would be annoying to have to audit the whole method and add in name. prefixes. Plus it breaks the simplicity of leaving out the name when the argument is unused from C and Go.

@ntrel ntrel closed this Mar 14, 2019
@medvednikov
Copy link
Member

It should be r.db.query_one, I'll fix it later today.

spaceface777 pushed a commit to spaceface777/v that referenced this pull request May 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants