% or - function combinator, f|g (...) = f(...), g(...)
%
% or ::
%    F:(A{1:N} => B{1:M}),
%    G:(A{1:N} => C{1:L}),
%    N:natural,              ~'defaults to nargin(F)'
%    M:natural               ~'defaults to nargout(F)'
% -> (A{1:N} => B{1:M}, C{1:L}).
function h=or(f,g,nin,nout)
	if nargin<4, nout=nargout(f); end
	if nargin<3, nin=nargin(f); end
	noutg=nargout(g);
	fns = { @q11, @q1n; @qn1, @qnn };
	h=fns{acount(nin,1),max(acount(nargout(g),1),acount(nout,1))};

	function [y,z]=q11(x), y=f(x); z=g(x); end
	function [y,z]=qn1(varargin), y=f(varargin{:}); z=g(varargin{:}); end
	function varargout=q1n(x), [varargout{1:nout}]=f(x); [varargout{nout+1:nargout}]=g(x); end
	function varargout=qnn(varargin), 
		[varargout{1:nout}]=f(varargin{:}); 
		[varargout{nout+(1:noutg)}]=g(varargin{:}); 
	end
end
