Anonymous user
Creating an Array: Difference between revisions
→{{header|E}}: merge in examples from deprecated Array Initialization task
(→{{header|E}}: merge in examples from deprecated Array Initialization task) |
|||
Line 350:
=={{header|E}}==
In accordance with its guarantees of determinism, you can never have an ''uninitialized'' array in E.
<lang e>[] # immutable, empty
[1,9,17] # immutable, 3 elements
[].diverge() # mutable, empty
[].diverge(int) # mutable, integers only
[1,2,3,4].diverge() # mutable, with initial contents
([0] * 1024).diverge() # mutable, with 1024 zeroes</lang>
If you want an array of some mutable objects, see [[N distinct objects#E]].
=={{header|Forth}}==
|