[jira] [Created] (GROOVY-7625) Slashy string in groovy allows brackets but double quoted string does not. Why?

2015-10-10 Thread Aseem Bansal (JIRA)
Aseem Bansal created GROOVY-7625:


 Summary: Slashy string in groovy allows brackets but double quoted 
string does not. Why?
 Key: GROOVY-7625
 URL: https://issues.apache.org/jira/browse/GROOVY-7625
 Project: Groovy
  Issue Type: Documentation
Reporter: Aseem Bansal
Priority: Minor


This

println("$()")

gives me a compiler error "Either escape a dollar sign or bracket the value 
expression"

But this 

println(/$()/)

prints `$()` fine. No errors

Why is there a difference? The only documented difference is that slashy 
strings make working with backslashes easier. I understand that a variable name 
cannot start with a bracket so it should be possible to make that special case. 
Is that the case for the slashy strings?

Just came across this when doing something with regex.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (GROOVY-7603) Update groovy docs for Category

2015-09-25 Thread Aseem Bansal (JIRA)

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

Aseem Bansal updated GROOVY-7603:
-
Description: 
Category docs refer to @Mixin but they are deprecated 
http://docs.groovy-lang.org/latest/html/gapi/groovy/lang/Category.html

I found that using traits is not possible. But it would be nice to be able to 
use them. 

Tried a workaround but didn't work

{noformat}
trait Util {
Number getTwice() { this * 2 }
Number max(Number otherNumber) { Math.max(this, otherNumber) }
}

@groovy.lang.Category(Number)
abstract class UtilCategory implements Util {
}
{noformat}


  was:
Category docs refer to @Mixin but they are deprecated 
http://docs.groovy-lang.org/latest/html/gapi/groovy/lang/Category.html

I found that using traits is not possible. But it would be nice to be able to 
use them. 


> Update groovy docs for Category
> ---
>
> Key: GROOVY-7603
> URL: https://issues.apache.org/jira/browse/GROOVY-7603
> Project: Groovy
>  Issue Type: Documentation
>Reporter: Aseem Bansal
>
> Category docs refer to @Mixin but they are deprecated 
> http://docs.groovy-lang.org/latest/html/gapi/groovy/lang/Category.html
> I found that using traits is not possible. But it would be nice to be able to 
> use them. 
> Tried a workaround but didn't work
> {noformat}
> trait Util {
> Number getTwice() { this * 2 }
> Number max(Number otherNumber) { Math.max(this, otherNumber) }
> }
> @groovy.lang.Category(Number)
> abstract class UtilCategory implements Util {
> }
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Created] (GROOVY-7603) Update groovy docs for Category

2015-09-25 Thread Aseem Bansal (JIRA)
Aseem Bansal created GROOVY-7603:


 Summary: Update groovy docs for Category
 Key: GROOVY-7603
 URL: https://issues.apache.org/jira/browse/GROOVY-7603
 Project: Groovy
  Issue Type: Documentation
Reporter: Aseem Bansal


Category docs refer to @Mixin but they are deprecated 
http://docs.groovy-lang.org/latest/html/gapi/groovy/lang/Category.html

Can traits be used?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (GROOVY-7604) traits docs diamond problem explanation

2015-09-25 Thread Aseem Bansal (JIRA)

[ 
https://issues.apache.org/jira/browse/GROOVY-7604?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=14908937#comment-14908937
 ] 

Aseem Bansal commented on GROOVY-7604:
--

I read further and found the section "Default conflict resolution" which gives 
the correct explanation

> traits docs diamond problem explanation
> ---
>
> Key: GROOVY-7604
> URL: https://issues.apache.org/jira/browse/GROOVY-7604
> Project: Groovy
>  Issue Type: Documentation
>Reporter: Aseem Bansal
>
> http://www.groovy-lang.org/objectorientation.html#_composition_of_behaviors
> has an example after referring diamond problem. Is it correct example for 
> diamond problem? Shouldn't the method names be the same?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (GROOVY-7603) Update groovy docs for Category

2015-09-25 Thread Aseem Bansal (JIRA)

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

Aseem Bansal updated GROOVY-7603:
-
Description: 
Category docs refer to @Mixin but they are deprecated 
http://docs.groovy-lang.org/latest/html/gapi/groovy/lang/Category.html

I found that using traits is not possible. But it would be nice to be able to 
use them. 

  was:
Category docs refer to @Mixin but they are deprecated 
http://docs.groovy-lang.org/latest/html/gapi/groovy/lang/Category.html

Can traits be used?


> Update groovy docs for Category
> ---
>
> Key: GROOVY-7603
> URL: https://issues.apache.org/jira/browse/GROOVY-7603
> Project: Groovy
>  Issue Type: Documentation
>Reporter: Aseem Bansal
>
> Category docs refer to @Mixin but they are deprecated 
> http://docs.groovy-lang.org/latest/html/gapi/groovy/lang/Category.html
> I found that using traits is not possible. But it would be nice to be able to 
> use them. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Created] (GROOVY-7605) Improve docs for MetaClass getMethods vs getMetaMethods

2015-09-25 Thread Aseem Bansal (JIRA)
Aseem Bansal created GROOVY-7605:


 Summary: Improve docs for MetaClass getMethods vs getMetaMethods
 Key: GROOVY-7605
 URL: https://issues.apache.org/jira/browse/GROOVY-7605
 Project: Groovy
  Issue Type: Documentation
Reporter: Aseem Bansal


The current explanation at 
http://docs.groovy-lang.org/latest/html/api/groovy/lang/MetaClass.html is not 
clear. 

I know that there is an explanation at 
http://www.groovy-lang.org/mailing-lists.html#nabble-td388327 but it just shows 
that Graeme added a method. I am guessing he added getMetaMethods.

As far as I can tell by running them getMethods is giving non-meta methods 
while getMetaMethods is only giving the meta. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (GROOVY-7592) Problem in switch statement docs

2015-09-21 Thread Aseem Bansal (JIRA)

[ 
https://issues.apache.org/jira/browse/GROOVY-7592?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=14901833#comment-14901833
 ] 

Aseem Bansal commented on GROOVY-7592:
--

[~pascalschumacher]
Did you fix the docs? Because I remember that there is another place where that 
is written. Don't remember exactly where.

> Problem in switch statement docs
> 
>
> Key: GROOVY-7592
> URL: https://issues.apache.org/jira/browse/GROOVY-7592
> Project: Groovy
>  Issue Type: Documentation
>  Components: Documentation
>Affects Versions: 2.4.5
>Reporter: Aseem Bansal
>Assignee: Pascal Schumacher
>Priority: Minor
> Fix For: 2.4.6
>
>
> As per http://www.groovy-lang.org/semantics.html default must be the last 
> thing in switch case. 
> Based on that I sent a PR which has been accepted
> https://github.com/apache/incubator-groovy/pull/82
> But when I tried to use default somewhere else it worked fine
> {noformat}
> String str = "aseem"
> switch(str) {
> default:
> println "default"
> break
> case "aseem":
> println "Aseem"
> break
> } 
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Created] (GROOVY-7578) Image present for metaprogramming is incorrect

2015-09-04 Thread Aseem Bansal (JIRA)
Aseem Bansal created GROOVY-7578:


 Summary: Image present for metaprogramming is incorrect
 Key: GROOVY-7578
 URL: https://issues.apache.org/jira/browse/GROOVY-7578
 Project: Groovy
  Issue Type: Documentation
Reporter: Aseem Bansal


I am reading groovy metaprogramming documentation and saw that the image 
present is wrong. I mean there is an image present but the flow is wrong.

It has a block "Method exists in MetaClass or Class" two times. One after 
GroovyInterceptable and other after the first "Method exists in MetaClass or 
Class" .

I tried a simple program and as per this I believe the first block should have 
class only and second block should have MetaClass only



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Created] (GROOVY-7579) Improve docs for invokeMethod

2015-09-04 Thread Aseem Bansal (JIRA)
Aseem Bansal created GROOVY-7579:


 Summary: Improve docs for invokeMethod
 Key: GROOVY-7579
 URL: https://issues.apache.org/jira/browse/GROOVY-7579
 Project: Groovy
  Issue Type: Documentation
Reporter: Aseem Bansal


I was reading meta programming documentation when I noticed that "this method 
is called when the method you called is not present on a Groovy object"

As per the diagram it is incorrect. It is invoked when methodMissing is not 
present. This statement is as per the diagram.

Also as per the answer at this is not an appropriate example  
http://stackoverflow.com/questions/19220370/what-is-the-difference-between-invokemethod-and-methodmissing

Saying this because the answer by blackdrag (who I understand is a core 
committer to groovy) says that methodMissing should be used instead. 

Also the same page mentions "overhead of invokeMethod". It would be nic e to 
have a better explanation in the section of invokeMethod itself.

I am not knowledgeable about this so cannot suggest what can be added. But it 
would be better to have the explanation in the official docs.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Created] (GROOVY-7580) ExpandoMetaClass append method does not throw an exception as per docs

2015-09-04 Thread Aseem Bansal (JIRA)
Aseem Bansal created GROOVY-7580:


 Summary: ExpandoMetaClass append method does not throw an 
exception as per docs
 Key: GROOVY-7580
 URL: https://issues.apache.org/jira/browse/GROOVY-7580
 Project: Groovy
  Issue Type: Bug
Reporter: Aseem Bansal


I was reading the docs when I came across "Note that the left shift operator is 
used to append a new method. If the method already exists an exception will be 
thrown."

I decided to try it via the below program. There was no exception. I am using 
groovy 2.3.8

{noformat}
class A {
}
A.metaClass.hello = {
  "hello superclass"
}

class B extends A {
}
B.metaClass.hello << {
  "hello subclass"
}

B.metaClass.hello << {
  "hello subclass"
}

new B().hello()
{noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Created] (GROOVY-7543) Suggestion for Download page

2015-08-07 Thread Aseem Bansal (JIRA)
Aseem Bansal created GROOVY-7543:


 Summary: Suggestion for Download page
 Key: GROOVY-7543
 URL: https://issues.apache.org/jira/browse/GROOVY-7543
 Project: Groovy
  Issue Type: Improvement
  Components: Documentation
Affects Versions: 2.4.4
 Environment: Website
Reporter: Aseem Bansal
Priority: Trivial


On the groovy website download page http://www.groovy-lang.org/download.html 
there is a System requirements at the bottom.

It says JVM Required. Is it minimum/maximum/only ? If it is based on some 
automated build to test compatibility it would be good to link that.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (GROOVY-7544) Nearly Duplicate sections in documentation

2015-08-07 Thread Aseem Bansal (JIRA)

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

Aseem Bansal updated GROOVY-7544:
-
Description: 
I was reading the documentation when I noticed that these two sections 
* http://www.groovy-lang.org/download.html
* http://www.groovy-lang.org/install.html

are nearly duplicate. It seems that due to duplicatacy both of them have some 
information which the other one does not have. It would be better to merge them 
into single section.

I would suggest to just keep the download section as it is better looking. 
Merge the extra information from install section and then delete the install 
section. 

  was:
I was reading the documentation when I noticed that these two sections 
* http://www.groovy-lang.org/download.html
* http://www.groovy-lang.org/install.html

are nearly duplicate. It seems that due to duplicatacy both of them have some 
information which the other ne does not have. It would be better to merge them 
into single section.


 Nearly Duplicate sections in documentation
 --

 Key: GROOVY-7544
 URL: https://issues.apache.org/jira/browse/GROOVY-7544
 Project: Groovy
  Issue Type: Improvement
  Components: Documentation
Affects Versions: 2.4.4
Reporter: Aseem Bansal

 I was reading the documentation when I noticed that these two sections 
 * http://www.groovy-lang.org/download.html
 * http://www.groovy-lang.org/install.html
 are nearly duplicate. It seems that due to duplicatacy both of them have some 
 information which the other one does not have. It would be better to merge 
 them into single section.
 I would suggest to just keep the download section as it is better looking. 
 Merge the extra information from install section and then delete the install 
 section. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (GROOVY-7543) Suggestion for Download page

2015-08-07 Thread Aseem Bansal (JIRA)

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

Aseem Bansal updated GROOVY-7543:
-
Description: 
On the groovy website download page http://www.groovy-lang.org/download.html 
there is a System requirements at the bottom.

It says JVM Required. Is it minimum/maximum/only version of JVM supported? If 
it is based on some automated build to test compatibility it would be good to 
link that.

  was:
On the groovy website download page http://www.groovy-lang.org/download.html 
there is a System requirements at the bottom.

It says JVM Required. Is it minimum/maximum/only ? If it is based on some 
automated build to test compatibility it would be good to link that.


 Suggestion for Download page
 

 Key: GROOVY-7543
 URL: https://issues.apache.org/jira/browse/GROOVY-7543
 Project: Groovy
  Issue Type: Improvement
  Components: Documentation
Affects Versions: 2.4.4
 Environment: Website
Reporter: Aseem Bansal
Priority: Trivial

 On the groovy website download page http://www.groovy-lang.org/download.html 
 there is a System requirements at the bottom.
 It says JVM Required. Is it minimum/maximum/only version of JVM supported? 
 If it is based on some automated build to test compatibility it would be good 
 to link that.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)