22 lines
246 B
Text
22 lines
246 B
Text
swap = function(x,y)
|
|
{
|
|
if (!exist($$.[x]))
|
|
{ return 0; }
|
|
if (!exist($$.[y]))
|
|
{ return 0; }
|
|
local (t);
|
|
t = $$.[x];
|
|
$$.[x] = $$.[y];
|
|
$$.[y] = t;
|
|
return 1;
|
|
};
|
|
|
|
>> a=1
|
|
1
|
|
>> b = "fish"
|
|
fish
|
|
>> swap( "a" , "b" );
|
|
>> a
|
|
fish
|
|
>> b
|
|
1
|