samer@10: % list_action - Make event action from list of times and parameters samer@10: % samer@10: % list_action :: samer@10: % timed_action({A},{}) ~'the action to perform at each time', samer@10: % seq cell { samer@10: % time ~'time of event', samer@10: % A ~'argument to pass to action' samer@10: % } ~'the list of times and parameters to action' samer@10: % -> time ~'time of first event', samer@10: % msched_action. samer@10: samer@10: function sch=list_schedule(action,X) samer@10: if isempty(X), sch={}; samer@10: else e0=head(X); sch={e0{1},@act}; end samer@10: samer@10: function [err,sch1]=act(t_sched) samer@10: err=action(t_sched,e0{2}); samer@10: sch1=list_schedule(action,next(X)); samer@10: end samer@10: end