You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@groovy.apache.org by Nathan Harvey <na...@gmail.com> on 2017/12/13 22:03:06 UTC

Package specific syntax

In Java,  methods and fields use package scope by default. In Groovy, they
use public. In order to make something package scope, you have to use the
@PackageScope annotation. This makes code look a bit messy but also doesn't
seem very intuitive. What if the "package" keyword was able to be applied,
in exactly the same way as "public" and "private" are? 

Example:
package void foo() {}



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

Re: Package specific syntax

Posted by MG <mg...@arscreat.com>.
Why is a keyword better than an annotation from an IDE developer's 
perspective (considering Groovy already has tons of annotations which 
more complex semantics than @PackageScope) ?


On 13.12.2017 23:14, Daniil Ovchinnikov wrote:
> This is the best way from IDE perspective.
>
> —
>
> Daniil Ovchinnikov
> JetBrains
> jetbrains.com <http://jetbrains.com>
> “Drive to develop"
>
>> On 14 Dec 2017, at 01:03, Nathan Harvey <nathanwharvey@gmail.com 
>> <ma...@gmail.com>> wrote:
>>
>> In Java,  methods and fields use package scope by default. In Groovy, 
>> they
>> use public. In order to make something package scope, you have to use the
>> @PackageScope annotation. This makes code look a bit messy but also 
>> doesn't
>> seem very intuitive. What if the "package" keyword was able to be 
>> applied,
>> in exactly the same way as "public" and "private" are?
>>
>> Example:
>> package void foo() {}
>>
>>
>>
>> --
>> Sent from: http://groovy.329449.n5.nabble.com/Groovy-Dev-f372993.html
>


Re: Package specific syntax

Posted by Daniil Ovchinnikov <da...@jetbrains.com>.
This: 

> Example:
> package void foo() {}

—

Daniil Ovchinnikov
JetBrains
jetbrains.com
“Drive to develop"

> On 14 Dec 2017, at 01:37, Nathan Harvey <na...@gmail.com> wrote:
> 
> I meant that the @PackageScope annotation made code look somewhat unreadable,
> and that the "package" keyword would be an ideal solution.
> 
> 
> 
> --
> Sent from: http://groovy.329449.n5.nabble.com/Groovy-Dev-f372993.html


Re: Package specific syntax

Posted by Nathan Harvey <na...@gmail.com>.
I meant that the @PackageScope annotation made code look somewhat unreadable,
and that the "package" keyword would be an ideal solution.



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

Re: Package specific syntax

Posted by mg <mg...@arscreat.com>.
"this" in this case being bound to ?-)(i.e. what do you mean by "this" - having a package keyword or an annotation ?)
-------- Ursprüngliche Nachricht --------Von: Daniil Ovchinnikov <da...@jetbrains.com> Datum: 13.12.17  23:14  (GMT+01:00) An: dev@groovy.apache.org Betreff: Re: Package specific syntax 
This is the best way from IDE perspective.


—

Daniil Ovchinnikov
JetBrains
jetbrains.com
“Drive to develop"


On 14 Dec 2017, at 01:03, Nathan Harvey <na...@gmail.com> wrote:
In Java,  methods and fields use package scope by default. In Groovy, they
use public. In order to make something package scope, you have to use the
@PackageScope annotation. This makes code look a bit messy but also doesn't
seem very intuitive. What if the "package" keyword was able to be applied,
in exactly the same way as "public" and "private" are? 

Example:
package void foo() {}



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


Re: Package specific syntax

Posted by Daniil Ovchinnikov <da...@jetbrains.com>.
This is the best way from IDE perspective.

—

Daniil Ovchinnikov
JetBrains
jetbrains.com
“Drive to develop"

> On 14 Dec 2017, at 01:03, Nathan Harvey <na...@gmail.com> wrote:
> 
> In Java,  methods and fields use package scope by default. In Groovy, they
> use public. In order to make something package scope, you have to use the
> @PackageScope annotation. This makes code look a bit messy but also doesn't
> seem very intuitive. What if the "package" keyword was able to be applied,
> in exactly the same way as "public" and "private" are? 
> 
> Example:
> package void foo() {}
> 
> 
> 
> --
> Sent from: http://groovy.329449.n5.nabble.com/Groovy-Dev-f372993.html