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

Allow underscore _ at end of identifiers #4327

Closed
zzz125 opened this issue Jun 13, 2016 · 4 comments
Closed

Allow underscore _ at end of identifiers #4327

zzz125 opened this issue Jun 13, 2016 · 4 comments

Comments

@zzz125
Copy link

zzz125 commented Jun 13, 2016

same topic on forum
http://forum.nim-lang.org/t/525

i'd like to have underscores in variable names at least
and with the latest "implicit self" feature ({.this: self.}) it allows to write code similar to this:
https://github.com/urho3d/Urho3D/blob/master/Source/Urho3D/Scene/Node.cpp#L48

with simple "class variable" access via "classVariable_.something"

@Araq
Copy link
Member

Araq commented Jun 13, 2016

A separator has nothing to do at the end of an identifier.

@zzz125
Copy link
Author

zzz125 commented Jun 14, 2016

maybe.
but virtually every language has trailing underscores
other options to use with implicit self are "m_var" or "mVar" are uglier than "var_"

example:
m_classVar.method =1
mClassVar.method = 1
classVar_.method = 1

@Araq
Copy link
Member

Araq commented Jun 14, 2016

They are not uglier than something that I cannot even talk about: "var with underscore (not to be confused with the other var without underscore)".

@johnnovak
Copy link
Contributor

Massive downvote from me... This would introduce an ugly special case to the way Nim name resolution works for questionable benefits. More weird special cases => more sources for subtle and hard to find bugs.

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

No branches or pull requests

3 participants