-module(compmacro2t).
-export([funct/1,message/1]).
-export([f_/1]).
-define( tuple_to_pair_rec, 
         (fun({E1,E2}) -> #pair{left=E1,right=E2};
             (X) -> X end)).
-record(pair,{left,right}).
-include("reclastfirst.hrl").


funct({A,B})->
    T = #rec{first=A, last=B},
    T#rec.first + T#rec.last.


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