% list_action - Make event action from list of times and parameters
%
% list_action ::
%    timed_action({A},{}) ~'the action to perform at each time',
%    seq cell {
%       time ~'time of event',
%       A    ~'argument to pass to action'
%    } ~'the list of times and parameters to action'
% -> time ~'time of first event',
%    msched_action.

function sch=list_schedule(action,X)
	if isempty(X), sch={};
	else e0=head(X); sch={e0{1},@act}; end

	function [err,sch1]=act(t_sched)
		err=action(t_sched,e0{2});
		sch1=list_schedule(action,next(X));
	end
end
