% and - function combinator, f&g (...) = f(...); return g(...)
%
% and ::
%    (A{:} => B{:}),
%    (A{:} => C{:})
% -> (A{:} => C{:}).
%
% and ::
%    (A{1:N} => B{:}),
%    (A{1:N} => C{1:M}),
%    N:natural,
%    M:natural
% -> (A{1:N} => C{1:M}).
function h=and(f,g,nin,nout)
	if nargin<4, nout=nargout(g); end
	if nargin<3, nin=nargin(g); end
	fns = { @q11, @q1n; @qn1, @qnn };
	h=fns{acount(nin,1),acount(nout,1)};
	function y=q11(x), f(x); y=g(x); end
	function y=qn1(varargin), f(varargin{:}); y=g(varargin{:}); end
	function varargout=q1n(x), f(x); [varargout{1:nargout}]=g(x); end
	function varargout=qnn(varargin), f(varargin{:}); [varargout{1:nargout}]=g(varargin{:}); end
end
