func swap(Ref a, Ref b) { var tmp = *a; *a = *b; *b = tmp; }