Jump to content

Collections: Difference between revisions

m
no edit summary
No edit summary
mNo edit summary
Line 1,542:
The result (or output) of this sequence is [10,1,2], so it is convenient to
speak of the operation ".[0] = 10" as simply a filter that sets the element at 0 to 10.
 
=={{header|Julia}}==
Julia has a wide variety of collections, including vectors, matrices, lists of Any data type, associative arrays, and bitsets.
There is a slicing notation similar to Python, but the base index is by default 1, not 0. In Julia, a collection is a just variable length array:
<lang julia>
 
julia> collection = []
0-element Array{Any,1}
 
julia> push!(collection, 1,2,4,7)
4-element Array{Any,1}:
1
2
4
7
</lang>
 
=={{header|Kotlin}}==
4,105

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.