Mercurial > hg > ishara
view general/funutils/tail_call.m @ 6:0ce3c2070089
Removed duplicate code and fixed doc in timed_action.
author | samer |
---|---|
date | Mon, 14 Jan 2013 14:33:37 +0000 |
parents | e44f49929e56 |
children | fbc0540a9208 |
line wrap: on
line source
% tail_call - Simulate effect of tail call % % tail_call :: (A{1:N}->B{1:M}), A{1:N} -> thunk(B{1:M}). % % thunk(B{1:M}) ::= % exists C{1:L} . cell { C{1:L}->B{1:M}, cell { C{1:L} } } % | cell { {0}, cell { B{1:L} } } % | unit -> B{1:M}. function ret=tail_call(fn,varargin), ret={fn,varargin}; end