-module(compmacrot).
-export([ident/1]).
-export([f_/1]).

-define( tuple_to_pair_rec, 
         (fun({E1,E2}) -> #pair{left=E1,right=E2};
             (X) -> X end)).
-record(pair,{left,right}).
ident(X)->
          X.


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

