Arrays: Difference between revisions

Content added Content deleted
(→‎{{header|Ecstasy}}: oops the previous edit wasn't supposed to post; I pressed "enter" to put a new line in and it posted it)
Line 3,127: Line 3,127:
{{out}}
{{out}}
<pre>
<pre>
literalArray=[1, 2, 3], &literalArray.actualType=immutable Array<Int>
literalArray.size=3, literalArray[2]=3
biggerArray=[1, 2, 3, 4], &biggerArray.actualType=immutable Array<Int>
biggestArray=[1, 2, 3, 4, 1, 2, 3, 4], &biggestArray.actualType=immutable Array<Int>
element at biggestArray[2]=3
immutable array not modified: biggestArray=[1, 2, 3, 4, 1, 2, 3, 4]
element at fixedLengthArray[2]=0
negOnes=[-1, -1, -1]
counting=[0, 1, 2, 3, 4]
replaced [1]=99: counting=[0, 99, 2, 3, 4]
Fixed mutability array not appendable: counting=[0, 99, 2, 3, 4]
literalArray.mutability=Constant, fixedLengthArray.mutability=Fixed
constantToMutable=[1, 2, 3, 4, 1, 2, 3, 4], &constantToMutable.actualType=Array<Int>, constantToMutable.mutability=Mutable
constantToFixed=[1, 2, 3, 4, 1, 2, 3, 4], &constantToFixed.actualType=Array<Int>, constantToFixed.mutability=Fixed
fixedToPersistent=[0, 99, 2, 3, 4], &fixedToPersistent.actualType=Array<Int>, fixedToPersistent.mutability=Persistent
fixedToConstant=[0, 99, 2, 3, 4], &fixedToConstant.actualType=immutable Array<Int>, fixedToConstant.mutability=Constant
slice=[2, 3]
constantToMutable=[1, 17, 18, 4, 1, 2, 3, 4], slice=[17, 3]
constantToMutable[1..2]=[17, 18]
constantToMutable[1..<2]=[17]
constantToMutable[1>..2]=[18]
constantToMutable[1>..<2]=[]
new variableArray=[]
new willBeGiantArray=[], willBeGiantArray.capacity=0
NASA count-down: variableArray=[10, 9, 8, 7, 6, 5, 4, 3, 2, 1]
lucky count-down: variableArray=[10, 9, 8, 7, 6, 5, 3, 2, 1]
aborted count-down: variableArray=[10, 9, 8, 7, 6, 5, 3, 2]
</pre>
</pre>