% foreach - do an action for each element in a sequence in order
%
% foreach :: (A=>void), seq(A), options {} -> action.
function foreach(f,X,varargin)
	iterate(@g,X,varargin{:});
	function x=g(x)
		f(head(x));
		x=next(x);
	end
end
