RosettaCodeData/Task/Generic-swap/SNOBOL4/generic-swap.sno
2023-07-01 13:44:08 -04:00

9 lines
304 B
Text

* SWAP(.V1, .V2) - Exchange the contents of two variables.
* The variables must be prefixed with the name operator
* when the function is called.
DEFINE('SWAP(X,Y)TEMP') :(SWAP_END)
SWAP TEMP = $X
$X = $Y
$Y = TEMP :(RETURN)
SWAP_END