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