jbe/bsw@0: --[[-- jbe/bsw@0: execute.multi_wrapped( jbe/bsw@0: wrapper_funcs, -- multiple wrapper functions (i.e. filters) jbe/bsw@0: inner_func -- inner function (i.e. an action or view) jbe/bsw@0: ) jbe/bsw@0: jbe/bsw@0: This function does the same as execute.wrapped(...), but with multiple wrapper functions, instead of just one wrapper function. It is used by execute.filtered_view{...} and execute.filtered_action{...} to wrap multiple filters around the view or action. jbe/bsw@0: jbe/bsw@0: --]]-- jbe/bsw@0: jbe/bsw@0: function execute.multi_wrapped(wrapper_funcs, inner_func) jbe/bsw@0: local function wrapped_execution(pos) jbe/bsw@0: local wrapper_func = wrapper_funcs[pos] jbe/bsw@0: if wrapper_func then jbe/bsw@0: return execute.wrapped( jbe/bsw@0: wrapper_func, jbe/bsw@0: function() jbe/bsw@0: wrapped_execution(pos+1) jbe/bsw@0: end jbe/bsw@0: ) jbe/bsw@0: else jbe/bsw@0: return inner_func() jbe/bsw@0: end jbe/bsw@0: end jbe/bsw@0: return wrapped_execution(1) jbe/bsw@0: end