Returns a new modifiable list, initialized with the specified items.
The list is implemented on top of an array, which has a couple of trade offs. Using an array means that updating individual items in the list is fast, while adding items to the list is potentially slow. Specifically adding items is slow when the backing array runs out of space, as a new larger array has to be created and the contents copied from the old array to the new(all completely transparent to the MillScript user).
Although the implementations are different the end result is a list that behaves in an almost identical way the that returned by newArrayList.
A simple example is always useful, e.g. to construct a new list with a variety of items:
:-) newVector( 1,2,3,4, "hello", <xml /> );
There is 1 result
[1, 2, 3, 4, hello, <xml />]
and another example showing the list is indeed modifiable:
:-) var aList = newVector( 1,2,3,4, "hello", <xml /> );
:-) aList[ 3 ] := "changed";
There are 0 results
:-) aList;
There is 1 result
[1, 2, changed, 4, hello, <xml />]
If you know that you will not update individual elements that often, but will add lots of items to the array, consider using newLinkedList instead.
If you know that you will never need to modify the list, consider using newLiteList instead.