main int[] vec // Creates a new vector named "vec" // that can contain ints vec &= 1 vec &= 2 vec &= 3 vec &= 4 vec &= 5 // vec has now value 1, 2, 3, 4, 5 print vec[0] // Prints 1 vec2 = vec[0 to 1] // Copies values from vec's index 0 to 1 to vec2, // so vec2 has now values 1, 2 vec[2 to 3] = vec2 // Replaces items at indices 2 and 3 in vec // with contents from vec2. // vec has now value 1, 2, 1, 2, 5 vec[2 size 0] = vec2 // Insert contents of vec2 before index 2 in vec. // vec has now values 1, 2, 1, 2, 1, 2, 5 print vec.get size // Prints number of elements in vec, now 7
