Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

2
  • bar.foo as you describe it is available. The problem is that bar can also be hidden by a local variable. Bad idea obviously if you want to access members of your bar object. I feel compelled to provide a "way out" of this situation, but maybe it's not even necessary. I'm interested in your opinion: how would you feel about a language where bar.foo is the only way to access a member of bar and if you create a local variable bar you close the door on that access? Meaning, you need to rename your local variable. Commented Jul 19, 2017 at 7:32
  • 1
    My point is that instead of allowing local variables/a this operator you always give some other named operator. I think allowing local variables to be named the same as global variables is a source of errors that people with less experience will miss too often. So if you always name them bar.foo and bla.foo (and never just foo) then you have an alternative way of dealing with this short of 'magic' @ tokens Commented Jul 19, 2017 at 16:42