annotate arrows/@loop/loop.m @ 11:8eec969fd4d3

Not used.
author samer
date Mon, 14 Jan 2013 15:52:31 +0000
parents 672052bd81f8
children
rev   line source
samer@0 1 % loop - Looping feedback arrow for stateful arrows.
samer@0 2 %
samer@0 3 % loop ::
samer@0 4 % (A, S -> B, S) ~'function to map input and state to output and next state',
samer@0 5 % (size -> S0:S) ~'function to map size of input to initial state'
samer@0 6 % -> arrow({A},{B},S) ~'arrow from A to B with state of type S'.
samer@0 7
samer@0 8 function o=loop(fn,s0)
samer@0 9 if nargin<1, fn=@(a,b)deal(a,b); s0=[]; end
samer@0 10 s.fn=fn; s.s0=s0;
samer@0 11 o=class(s,'loop',arrow(1,1));
samer@0 12 end
samer@0 13