[VOTE]Support package scope via `package` keyword

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
16 messages Options
12
Reply | Threaded
Open this post in threaded view
|

[VOTE]Support package scope via `package` keyword

Daniel Sun
Hi all,

      In order to support package scope, we have to add annotation
`@PackageScope` to the target(e.g. class, field, method), which is verbose.
Nathan Harvey has started a thread to discuss specifying the package scope
via `package` keyword[1]. The feature is feasible and has been implemented
in my labs project[2].

      Please vote on add the new feature to Apache Groovy 3.0.0 and 2.6.0
releases.

      The vote is open for the next 72 hours and passes if a majority of at
least three +1 PMC votes are cast.

[ ] +1  The feature sounds good
[ ]   0  I don't have a strong opinion about this, but I assume it's ok
[ ]  -1  Because...

Cheers,
Daniel.Sun

[1]
http://groovy.329449.n5.nabble.com/Package-specific-syntax-tp5745613.html
[2] https://github.com/danielsun1106/groovy-parser/tree/package-scope




--
Sent from: http://groovy.329449.n5.nabble.com/Groovy-Dev-f372993.html
Reply | Threaded
Open this post in threaded view
|

Re: [VOTE]Support package scope via `package` keyword

Daniel Sun
Reply | Threaded
Open this post in threaded view
|

Re: [VOTE]Support package scope via `package` keyword

Nathan Harvey
In reply to this post by Daniel Sun
Great work, Daniel. Very happy to see my ideas be made a reality! I won't
vote either way.



--
Sent from: http://groovy.329449.n5.nabble.com/Groovy-Dev-f372993.html
Reply | Threaded
Open this post in threaded view
|

Re: [VOTE]Support package scope via `package` keyword

Daniel.Sun
We should collect at least three +1 from PMC(e.g. Guillaume, Jochen, Cédric,
Paul, John, etc. )   ;-)

Here is the complete list :
http://people.apache.org/phonebook.html?pmc=groovy


Cheers,
Daniel.Sun



--
Sent from: http://groovy.329449.n5.nabble.com/Groovy-Dev-f372993.html
Daniel Sun
Apache Groovy committer

Blog: http://blog.sunlan.me
Twitter: @daniel_sun
Reply | Threaded
Open this post in threaded view
|

Re: [VOTE]Support package scope via `package` keyword

paulk_asert
In reply to this post by Daniel Sun
Just so I understand, the intention is to keep @PackageScope with `package` being an alias for when no target is required. Correct?

If that's correct, it won't eliminate the need for IDEs to scan for @PackageScope in general but in some common cases, some preliminary assumptions could be made.

Also, when documenting, we should note that `package` will be more concise when used in one or two places within a class but @PackageScope will be more concise if used with a PackageScopeTarget when a few (or more) members should be made package private. Come to think of it, I wonder if there should be an `ALL` target?

Paul.

On Fri, Dec 29, 2017 at 12:40 PM, Daniel Sun <[hidden email]> wrote:
Hi all,

      In order to support package scope, we have to add annotation
`@PackageScope` to the target(e.g. class, field, method), which is verbose.
Nathan Harvey has started a thread to discuss specifying the package scope
via `package` keyword[1]. The feature is feasible and has been implemented
in my labs project[2].

      Please vote on add the new feature to Apache Groovy 3.0.0 and 2.6.0
releases.

      The vote is open for the next 72 hours and passes if a majority of at
least three +1 PMC votes are cast.

[ ] +1  The feature sounds good
[ ]   0  I don't have a strong opinion about this, but I assume it's ok
[ ]  -1  Because...

Cheers,
Daniel.Sun

[1]
http://groovy.329449.n5.nabble.com/Package-specific-syntax-tp5745613.html
[2] https://github.com/danielsun1106/groovy-parser/tree/package-scope




--
Sent from: http://groovy.329449.n5.nabble.com/Groovy-Dev-f372993.html

Reply | Threaded
Open this post in threaded view
|

Re: [VOTE]Support package scope via `package` keyword

Daniel.Sun
Hi Paul,

> Just so I understand, the intention is to keep @PackageScope with
> `package` being an alias for when no target is required. Correct?

Yeah, correct :-)

> Come to think of it, I wonder if there should be an `ALL` target?
I agree with you that the target of @PackageScope should be `ALL`

your vote is ?

Cheers,
Daniel.Sun



--
Sent from: http://groovy.329449.n5.nabble.com/Groovy-Dev-f372993.html
Daniel Sun
Apache Groovy committer

Blog: http://blog.sunlan.me
Twitter: @daniel_sun
Reply | Threaded
Open this post in threaded view
|

Re: [VOTE]Support package scope via `package` keyword

paulk_asert


On Fri, Dec 29, 2017 at 8:34 PM, Daniel.Sun <[hidden email]> wrote:
Hi Paul,

> Just so I understand, the intention is to keep @PackageScope with
> `package` being an alias for when no target is required. Correct?

Yeah, correct :-)

> Come to think of it, I wonder if there should be an `ALL` target?
I agree with you that the target of @PackageScope should be `ALL`


I am unsure if I made myself clear. I think the default should remain as CLASS but there could be an additional ALL enum value. Then again we could just have a PackageScopeTarget[] ALL constant (though we have an outstanding issue around using constants in annotation attributes we'd have to check didn't get in the way).
 
your vote is ?

I am at least a +0, just pondering the real merit given that it doesn't really save much work for IDE writers and it won't be more concise for a range of typical use cases. It doesn't scream a +1 for me but I'll ponder for a few more days. I'm keen to hear more thoughts.

Cheers, Paul.
 

Cheers,
Daniel.Sun

Reply | Threaded
Open this post in threaded view
|

Re: [VOTE]Support package scope via `package` keyword

Jochen Theodorou
In reply to this post by Daniel Sun
On 29.12.2017 03:40, Daniel Sun wrote:
> Hi all,
>
>        In order to support package scope, we have to add annotation
> `@PackageScope` to the target(e.g. class, field, method), which is verbose.
> Nathan Harvey has started a thread to discuss specifying the package scope
> via `package` keyword[1]. The feature is feasible and has been implemented
> in my labs project[2].

Just to be clear, this feature, this is a change for IDEs, not for the
user directly. For example a project I am working on with like 90k lines
of code, I think I used package private 3 times...no 2 times, because
the other got changed.

>        Please vote on add the new feature to Apache Groovy 3.0.0 and 2.6.0
> releases.
>
>        The vote is open for the next 72 hours and passes if a majority of at
> least three +1 PMC votes are cast.
>
> [ ] +1  The feature sounds good
> [ ]   0  I don't have a strong opinion about this, but I assume it's ok
> [ ]  -1  Because...

You get a +1 from me, but under the condition to deprecate @PackageScope
in 2.6.0 and then I would like to have it removed in 3.0.0 (if we want
to be serious about cleanups, that is)

bye Jochen
Reply | Threaded
Open this post in threaded view
|

Re: [VOTE]Support package scope via `package` keyword

Jochen Theodorou
In reply to this post by paulk_asert
On 29.12.2017 11:58, Paul King wrote:
[...]
> I am unsure if I made myself clear. I think the default should remain as
> CLASS but there could be an additional ALL enum value. Then again we
> could just have a PackageScopeTarget[] ALL constant (though we have an
> outstanding issue around using constants in annotation attributes we'd
> have to check didn't get in the way).

It doesn´t make sense on local variables, the package, parameters or
parameter types... Maybe I misunderstood what you mean with "ALL"


bye Jochen
Reply | Threaded
Open this post in threaded view
|

Re: [VOTE]Support package scope via `package` keyword

Daniel.Sun
In reply to this post by Jochen Theodorou
Hi Jochen,

      Thanks for your voting :-)

> but under the condition to deprecate @PackageScope in 2.6.0 and then I
> would like to have it removed in 3.0.0 (if we want to be serious about
> cleanups, that is)

       Yeah, we can do better step by step.

Cheers,
Daniel.Sun



--
Sent from: http://groovy.329449.n5.nabble.com/Groovy-Dev-f372993.html
Daniel Sun
Apache Groovy committer

Blog: http://blog.sunlan.me
Twitter: @daniel_sun
12