comparison general/funutils/tail_call.m @ 4:e44f49929e56

Adding reorganised general toolbox, now in several subdirectories.
author samer
date Sat, 12 Jan 2013 19:21:22 +0000
parents
children fbc0540a9208
comparison
equal deleted inserted replaced
3:3f77126f7b5f 4:e44f49929e56
1 % tail_call - Simulate effect of tail call
2 %
3 % tail_call :: (A{1:N}->B{1:M}), A{1:N} -> thunk(B{1:M}).
4 %
5 % thunk(B{1:M}) ::=
6 % exists C{1:L} . cell { C{1:L}->B{1:M}, cell { C{1:L} } }
7 % | cell { {0}, cell { B{1:L} } }
8 % | unit -> B{1:M}.
9 function ret=tail_call(fn,varargin), ret={fn,varargin}; end