annotate arrows/@aswitch/aswitch.m @ 27:5de03f77dae1

Added documentation about types and revised arrow type specifications.
author samer
date Sat, 19 Jan 2013 14:22:09 +0000
parents 672052bd81f8
children
rev   line source
samer@0 1 % aswitch - switching arrow
samer@0 2 %
samer@0 3 % aswitch ::
samer@27 4 % arrow(A@typelist(N),B@typelist(M),S)
samer@0 5 % -> arrow([A,{box(arrow(A,B,S))}], B,S).
samer@0 6 %
samer@0 7 % The resulting arrow has N+1 inputs and M outputs. The last input
samer@0 8 % is for boxed arrows, that is, a stream of events consisting of
samer@0 9 % arrows. When a new arrow arrives, the aswitch arrow starts behaving
samer@0 10 % like it.
samer@0 11
samer@0 12 function o=aswitch(a)
samer@0 13 s.base=a;
samer@0 14 o=class(s,'aswitch',arrow(nargin(a)+1,nargout(a)));
samer@0 15 end