Read Me - Common Public License V1.0 - Copyright Notice(©)

put


            +--------+
            V        |
>>-put(item---,index-+-)---------------------------------------><

Makes the object [item] a member item of the array and associates it with the specified [index] or [index] es. This replaces any existing item associated with the specified [index] or [index] es with the new item. If the [index] for a particular dimension is greater than the current size of that dimension, the array is expanded to the new dimension size.

Note that the index argument may also be specified as an array of indexes.

[Examples:]

Array class - put method

a = .array~new
a~put("Fred", 1) -- a = .array~of("Fred")
a~put("Mike", 2) -- a = .array~of("Fred", "Mike")
a~put("Mike", 1) -- a = .array~of("Mike", "Mike")

do name over a
  say name
end

/* Output would be: */

Mike
Mike

Read Me - Common Public License V1.0 - Copyright Notice(©)