[jira] [Updated] (GROOVY-2521) keyword 'use' like 'import (static)' to use categories in a complete compilation unit

2023-12-15 Thread Eric Milles (Jira)


 [ 
https://issues.apache.org/jira/browse/GROOVY-2521?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Eric Milles updated GROOVY-2521:

Fix Version/s: (was: 4.x)

> keyword 'use' like 'import (static)' to use categories in a complete 
> compilation unit
> -
>
> Key: GROOVY-2521
> URL: https://issues.apache.org/jira/browse/GROOVY-2521
> Project: Groovy
>  Issue Type: New Feature
>Reporter: Jörg Gottschling
>Priority: Major
>
> I'd like to have a keyword 'use' which can be used at the beginning of a 
> file, like a static import, but as category. So:
> The first example from http://groovy.codehaus.org/Groovy+Categories :
> import groovy.xml.*
> def html =  /* ... */
> use (groovy.xml.dom.DOMCategory) {
>   assert html.head.title.text() == 'Test'
>   // ...
> }
> Would then become:
> import groovy.xml.*
> use groovy.xml.dom.DOMCategory
> def html = /* ... */
> assert html.head.title.text() == 'Test'
> assert html.body.p.text() == 'This is a test.'
> // ...
> I think this is extremely usefull when using a category in more then one 
> method.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Updated] (GROOVY-2521) keyword 'use' like 'import (static)' to use categories in a complete compilation unit

2020-01-27 Thread Paul King (Jira)


 [ 
https://issues.apache.org/jira/browse/GROOVY-2521?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Paul King updated GROOVY-2521:
--
Fix Version/s: (was: 3.x)
   4.x

> keyword 'use' like 'import (static)' to use categories in a complete 
> compilation unit
> -
>
> Key: GROOVY-2521
> URL: https://issues.apache.org/jira/browse/GROOVY-2521
> Project: Groovy
>  Issue Type: New Feature
>Reporter: Jörg Gottschling
>Priority: Major
> Fix For: 4.x
>
>
> I'd like to have a keyword 'use' which can be used at the beginning of a 
> file, like a static import, but as category. So:
> The first example from http://groovy.codehaus.org/Groovy+Categories :
> import groovy.xml.*
> def html =  /* ... */
> use (groovy.xml.dom.DOMCategory) {
>   assert html.head.title.text() == 'Test'
>   // ...
> }
> Would then become:
> import groovy.xml.*
> use groovy.xml.dom.DOMCategory
> def html = /* ... */
> assert html.head.title.text() == 'Test'
> assert html.body.p.text() == 'This is a test.'
> // ...
> I think this is extremely usefull when using a category in more then one 
> method.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)