Mercurial > hg > ishara
changeset 40:62304c930111
Reversed order of * function composition to match arrow * combinator.
author | samer |
---|---|
date | Tue, 29 Jan 2013 17:04:40 +0000 |
parents | c388f1c70669 |
children | 79632e7bcb52 |
files | general/funutils/@function_handle/mtimes.m |
diffstat | 1 files changed, 2 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/general/funutils/@function_handle/mtimes.m Tue Jan 29 17:02:00 2013 +0000 +++ b/general/funutils/@function_handle/mtimes.m Tue Jan 29 17:04:40 2013 +0000 @@ -1,13 +1,12 @@ -function h=mtimes(f,g) +function h=mtimes(g,f) % compose - Constructs composition of two functions % -% compose :: (B{:}->C{:}), (A{:}->B{:}) -> (A{:}->C{:}). +% compose :: (A{:}->B{:}), (B{:}->C{:}) -> (A{:}->C{:}). % % returns the function h such that h(...) = f(g(...)) % If functions have multiple returns and arguments, outputs % from g are routed to f. - h=@fg; n1=nargout(g); if n1<0, n1=inf; end n2=nargin(f); if n2<0, n2=inf; end n3=nargout(f); if n3<0, n3=inf; end