Skip to content

sset

Input Stack:
key: String
value: Any
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
PosInputOutput
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)
  • :set - Set variables with standard stack order
  • :swap - Swap stack items (:sset includes this operation)
  • :get - Retrieve stored variable values