Issue Details (XML | Word | Printable)

Key: GROOVY-1543
Type: New Feature New Feature
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Jochen Theodorou
Reporter: Graeme Rocher
Votes: 1
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
groovy

Support multiple declarations at once: def a,b = 1,2

Created: 02/Nov/06 06:08 AM   Updated: 09/Oct/08 12:40 PM   Resolved: 09/Oct/08 12:40 PM
Return to search
Component/s: syntax
Affects Version/s: None
Fix Version/s: 1.6-beta-2

Time Tracking:
Not Specified

Issue Links:
Duplicate
 
Related
 


 Description  « Hide

We should support multiple declarations at once:

def a, b = 1,2

Or more advanced

def a, b = [1,2,3], [4,5,6]



Guillaume Laforge made changes - 02/Nov/06 06:23 AM
Field Original Value New Value
Link This issue is duplicated by GROOVY-1544 [ GROOVY-1544 ]
Guillaume Laforge made changes - 20/Jan/07 03:27 PM
Assignee Guillaume Laforge [ guillaume ]
Guillaume Laforge made changes - 13/Feb/07 07:48 AM
Fix Version/s 1.1-beta-2 [ 10436 ]
Paul King made changes - 06/Jan/08 01:46 AM
Link This issue is related to GROOVY-158 [ GROOVY-158 ]
Paul King added a comment - 06/Jan/08 01:46 AM

Some overlap with GROOVY-158 but not quite the same - leaving both open for now.


Jochen Theodorou added a comment - 22/Apr/08 07:13 AM

should work now


Jochen Theodorou made changes - 22/Apr/08 07:13 AM
Assignee Jochen Theodorou [ blackdrag ]
Resolution Fixed [ 1 ]
Fix Version/s 1.6 [ 13832 ]
Status Open [ 1 ] Closed [ 6 ]
Paul King added a comment - 22/Apr/08 06:28 PM

Isn't that the difference between GROOVY-158 and this issue?

Currently we allow:

def a, b
[a, b] = [[1,2,3], [4,5,6]]

but this issue wants:

def [a, b] = [[1,2,3], [4,5,6]]

which we don't allow?


Jochen Theodorou added a comment - 23/Apr/08 02:13 AM

ah, ok, didn't see that


Jochen Theodorou made changes - 23/Apr/08 02:13 AM
Status Closed [ 6 ] Reopened [ 4 ]
Resolution Fixed [ 1 ]
Jochen Theodorou added a comment - 23/Apr/08 02:14 AM

but I doubt we can have this in 1.6


Jochen Theodorou added a comment - 09/Oct/08 12:40 PM

it is now

def (a,b) = [[1,2],[3,4]]

and

(a,b) = [1,2]


Jochen Theodorou made changes - 09/Oct/08 12:40 PM
Resolution Fixed [ 1 ]
Fix Version/s 1.6 [ 13832 ]
Fix Version/s 1.6-beta-2 [ 14261 ]
Status Reopened [ 4 ] Closed [ 6 ]