-module(macro2t).
-export([f_/1]).
-record(pair,{left,right}).
-define( tuple_to_pair_rec, 
         (fun({E1,E2}) -> #pair{left=E1,right=E2};
             (X) -> X end)).



f_({A,0}) -> A;
f_(R) -> 
    f_(fun(#pair{left=X,right=Y})->{Y, X rem Y} end
         (?tuple_to_pair_rec(R))).


