set

set collection's item at index to given value


Parameters

set collection :string :binary :dictionary :object :store :block :bytecode
    index :any
    value :any

Returns

  • :nothing

Examples

copy
myDict: #[ name: "John" age: 34 ] set myDict 'name "Michael" ; => [name: "Michael", age: 34]

copy
arr: [1 2 3 4] set arr 0 "one" ; => ["one" 2 3 4] arr\1: "dos" ; => ["one" "dos" 3 4] x: 2 arr\[x]: "tres" ; => ["one" "dos" "tres" 4]

copy
str: "hello" str\0: `x` print str ; xello

Related