sset
Input Stack:
|
⇨ | Output Stack: |
Set a variable by swapping the stack order first. This is equivalent to :swap,:set
and
is useful when you have the key and value in the wrong order on the stack.
Parameters¶
- key: The variable name (string identifier) - expected on second position
- value: The value to store (can be any type) - expected on top of stack
Examples¶
Setting a variable with swapped stack order:
a,b,:sset
Pos | Input | Output |
---|---|---|
0 | b | |
1 | a |
This is equivalent to: a,b,:swap,:set
which stores value "a" under key "b".
Stack Order Difference¶
:set
expects:key, value, :set
(key on bottom, value on top):sset
expects:value, key, :sset
(value on bottom, key on top)