Thread overview
Protected package?
Oct 24, 2018
12345swordy
Oct 25, 2018
12345swordy
Oct 25, 2018
12345swordy
October 24, 2018
It says here that:
"package extends private so that package members can be accessed from code in other modules that are in the same package. If no identifier is provided, this applies to the innermost package only, or defaults to private if a module is not nested in a package."

Can this be extended to the protected visibility attribute?
If not, then does it need an DIP to do so?

-Alex
October 25, 2018
On Wednesday, 24 October 2018 at 23:36:56 UTC, 12345swordy wrote:
> It says here that:
> "package extends private so that package members can be accessed from code in other modules that are in the same package. If no identifier is provided, this applies to the innermost package only, or defaults to private if a module is not nested in a package."
>
> Can this be extended to the protected visibility attribute?
> If not, then does it need an DIP to do so?
>
> -Alex

Well I don't think there no harm of doing so.
October 25, 2018
On 10/25/18 12:45 PM, 12345swordy wrote:
> On Wednesday, 24 October 2018 at 23:36:56 UTC, 12345swordy wrote:
>> It says here that:
>> "package extends private so that package members can be accessed from code in other modules that are in the same package. If no identifier is provided, this applies to the innermost package only, or defaults to private if a module is not nested in a package."
>>
>> Can this be extended to the protected visibility attribute?
>> If not, then does it need an DIP to do so?
>>
> 
> Well I don't think there no harm of doing so.

Sorry, I'm not sure what the question is.

What is "this" and how is it being extended to protected?

FYI, I didn't know that you could package something to a specific identifier, interesting.

-Steve
October 25, 2018
On Thursday, 25 October 2018 at 19:48:43 UTC, Steven Schveighoffer wrote:
> On 10/25/18 12:45 PM, 12345swordy wrote:
>> On Wednesday, 24 October 2018 at 23:36:56 UTC, 12345swordy wrote:
>>> It says here that:
>>> "package extends private so that package members can be accessed from code in other modules that are in the same package. If no identifier is provided, this applies to the innermost package only, or defaults to private if a module is not nested in a package."
>>>
>>> Can this be extended to the protected visibility attribute?
>>> If not, then does it need an DIP to do so?
>>>
>> 
>> Well I don't think there no harm of doing so.
>
> Sorry, I'm not sure what the question is.
>
> What is "this" and how is it being extended to protected?
>
> FYI, I didn't know that you could package something to a specific identifier, interesting.
>
> -Steve

The package visibility attribute. It is an extension of private, which means that it is not inheritable.
October 25, 2018
On 10/25/18 3:53 PM, 12345swordy wrote:
> On Thursday, 25 October 2018 at 19:48:43 UTC, Steven Schveighoffer wrote:
>> On 10/25/18 12:45 PM, 12345swordy wrote:
>>> On Wednesday, 24 October 2018 at 23:36:56 UTC, 12345swordy wrote:
>>>> It says here that:
>>>> "package extends private so that package members can be accessed from code in other modules that are in the same package. If no identifier is provided, this applies to the innermost package only, or defaults to private if a module is not nested in a package."
>>>>
>>>> Can this be extended to the protected visibility attribute?
>>>> If not, then does it need an DIP to do so?
>>>>
>>>
>>> Well I don't think there no harm of doing so.
>>
>> Sorry, I'm not sure what the question is.
>>
>> What is "this" and how is it being extended to protected?
>>
>> FYI, I didn't know that you could package something to a specific identifier, interesting.
>>
> 
> The package visibility attribute. It is an extension of private, which means that it is not inheritable.

I think what you are asking is for a "package protected" attribute that acts like protected, but ONLY for modules inside the given package, right?

You would need new syntax for this, for sure. So I think a DIP might be required. There is a problem with having package protected be something different, because right now a visibility attribute overrides, not adds to, an existing attribute.

-Steve