Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 355745

Summary: Implement array language changes
Product: z_Archived Reporter: Matt Heitz <mheitz>
Component: EDTAssignee: Project Inbox <edt.debug-inbox>
Status: CLOSED WORKSFORME QA Contact:
Severity: enhancement    
Priority: P1 CC: jspadea
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Matt Heitz CLA 2011-08-24 12:32:29 EDT
This work needs to be completed in Iteration 13.  Prioritize it ahead of other
enhancements, even if they'll have to be pushed out of the iteration.

[The following is the section on Array Declarations from
http://wiki.eclipse.org/EDT:EGL_Language_Statements.]


Arrays can't be declared with an initial size
---------------------------------------------
Arrays can't be declared with an initial size. The size of an array isn't part of its type. That's why in RBD you can declare an int[5] and then assign [1,2,3] to it -- you change its length from 5 to 3. In EDT, all arrays must be declared without an initial size.

A size is still allowed on a new expression when you create an array.

Here are some example array declarations for EDT:

    a int[] = new int[3];
    a int[] = [1, 2, 3];
    a int[]; // This is an array of length zero.
    a int[]?; // Initially null.
    a int[]? {}; // This is an array of length zero. 


Initializing arrays with literals
---------------------------------
Array initializers must be efficient. "a int[] = [1, 2, 3];" means make an array of three elements, values 1 then 2 then 3. Do not make a zero-length array, then make an array from the literal, and throw away the original zero-length array.


Initializing arrays with set-values blocks
------------------------------------------
A set-values block on an array declaration causes the values within the block to be appended to the array. For example "a int[] { 1, 2, 3 };" results in [1, 2, 3]. The block has a different effect in RBD: it sets elements rather than appending them, so you'd get an index out of bounds exception on the declaration "a int[] { 1, 2, 3 };".
Comment 1 Justin Spadea CLA 2011-08-31 14:33:38 EDT
There's nothing to do in debug for this change.
Comment 2 Matt Heitz CLA 2011-09-08 13:27:08 EDT
Closing.
Comment 3 Matt Heitz CLA 2011-09-08 13:57:44 EDT
Closing for real this time.