# HG changeset patch # User samer # Date 1359479080 0 # Node ID 62304c930111936219cce8e1d6d585377cd4233a # Parent c388f1c706690a4447ab85ec10289db1095dbfed Reversed order of * function composition to match arrow * combinator. diff -r c388f1c70669 -r 62304c930111 general/funutils/@function_handle/mtimes.m --- 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