Input/Output:
Level 3/Argument 1 Level 2/Argument 2 Level 1/Argument 3 Level 1/Item 1
|
| [[ matrix ]]1 | nposition |
|
| zput | → | [[ matrix ]]2 | |||||||||
|
| [[ matrix ]]1 | { nrow mcol } | zput | → | [[ matrix ]]2 | |||||||||||
|
| 'name |
|
| ' | n | position |
|
| z | put | → |
| ||||
|
|
| matrix |
|
|
|
|
|
| ||||||||
|
| 'name |
| ' | { n | row | m | col | } | z | put | → |
| ||||
|
|
|
| matrix |
|
|
|
|
| ||||||||
|
| [ vector ]1 | nposition |
|
| zput | → | [ vector ]2 | |||||||||
|
| [ vector ]1 | { nposition | } | zput | → | [ vector ]2 | ||||||||||
|
| 'namevector' | nposition |
|
| zput | → |
| |||||||||
|
| 'namevector' | { nposition | } | zput | → |
| ||||||||||
|
| { list}1 | nposition |
|
| objput | → | { list }2 | |||||||||
|
| { list }1 | { nposition | } | objput | → | { list }2 | ||||||||||
|
| 'name | ' | n | position |
|
| obj | put | → |
| ||||||
|
|
|
| list |
|
|
|
|
|
|
|
| |||||
|
| 'name | ' | { n | position | } | obj | put | → |
| |||||||
|
|
|
| list |
|
|
|
|
|
|
|
| |||||
Example 1: | This command sequence: |
|
|
|
|
|
|
|
|
|
|
|
| ||||
| [[ 2 3 4 ][ 4 1 2 ]] { 1 3 } 96 PUT returns |
|
| ||||||||||||||
| [[ 2 3 96 ][ 4 1 2 ]]. |
|
|
|
|
|
|
|
|
|
|
|
Example 2: The command sequence:
[[ 2 3 4 ][ 4 1 2 ]] 5 96 PUT returns [[ 2 3 4 ][ 4 96 2 ]].
Example 3: The command sequence:
{ A B C D E } { 3 } 'Z' PUT returns { A B Z D E }.
See also: GET, GETI, PUTI
PUTIType: | Command |
|
Description: | Put and Increment Index Command: Replaces the object at a specified position (second input) in | |
| a specified array or list (first input) with a specified object (third input), returning a new array or | |
| list together with the next position in the array or list. | |
| For matrices, the position is incremented in row order. | |
| Unlike PUT, PUTI returns a named array or list. This enables a subsequent execution of PUTI at | |
| the next position of a named array or list. |
|
Access: | !°LIST ELEMENTS PUTI | ( °is the |
Flags: | Index Wrap Indicator |
|