Mercurial > hg > ishara
annotate general/funutils/tail_call.m @ 28:673b8e45d05a
Tidied up indentation.
author | samer |
---|---|
date | Sat, 19 Jan 2013 14:40:54 +0000 |
parents | fbc0540a9208 |
children |
rev | line source |
---|---|
samer@4 | 1 % tail_call - Simulate effect of tail call |
samer@4 | 2 % |
samer@4 | 3 % tail_call :: (A{1:N}->B{1:M}), A{1:N} -> thunk(B{1:M}). |
samer@4 | 4 % |
samer@4 | 5 % thunk(B{1:M}) ::= |
samer@4 | 6 % exists C{1:L} . cell { C{1:L}->B{1:M}, cell { C{1:L} } } |
samer@4 | 7 % | cell { {0}, cell { B{1:L} } } |
samer@12 | 8 % | void -> B{1:M}. |
samer@4 | 9 function ret=tail_call(fn,varargin), ret={fn,varargin}; end |