About Go, D module naming

deadalnix deadalnix at gmail.com
Fri Dec 28 14:00:43 PST 2012


On Friday, 28 December 2012 at 21:12:48 UTC, Andrei Alexandrescu 
wrote:
> On 12/24/12 6:20 AM, Jacob Carlborg wrote:
>> On 2012-12-24 01:11, Walter Bright wrote:
>>
>>> 1. what access means at module scope
>>> 2. at class scope
>>> 3. at template mixin scope
>>> 4. backwards compatibility
>>> 5. overloading at each scope level and the interactions with 
>>> access
>>> 6. I'd also throw in getting rid of the "protected" access 
>>> attribute
>>> completely, as I've seen debate over that being a useless idea
>>> 7. there's also some debate about what "package" should mean
>>
>> I also want to add:
>>
>> 8. Investigate the usefulness and possibility to combine 
>> multiple access
>> attributes for more fine grained control, i.e. using "package" 
>> and
>> "protected" on a single declaration
>
> Has anyone started a DIP on this? Let's not let things scroll 
> away from the institutional memory.
>
> Andrei

I feel like the issue is much deeper. I have no clue what the 
priorities are when resolving some identifiers, and the doc is 
unclear about it, and dmd is sometime inconsistent, or some other 
time don't implement the feature (for instance multiple alias 
this).

In a.b , b can be :
  1 a member of a.
  2 a member of an alias this of a.
  3 any recursion of the case 2.
  4 an UFCS function.
  5 an UFCS function using an alias this of a as argument.
  6 any recursion of 5.
  7 an imported symbol at scope level.
  8 repeat 4, 5 and 6 with that imported symbol.
  9 an imported symbol at module level.
  10 repeat 4, 5 and 6 with that imported symbol.
  11 all cases I have forgotten as I wrote that quickly.

It is unclear when they take priorities over each other and when 
they collide. Visibility is another variable to the equation, but 
in a first place, this is unclear without them.


More information about the Digitalmars-d mailing list