Anonymous user
Array: Difference between revisions
→Smalltalk
Line 232:
"an new created array with 5 elements computed from expressions (at run time)"
a3 := { 10 . 20 . (a1 at:3) . 40 squared }.
▲<lang smalltalk>"access by index (notice: in Smalltalk index starts at 1)"
a1 at:2. -> 20
a1 at:index put:100. -> error; immutable
|