Iterator.run
From OpenEUO
Revision as of 11:52, 24 November 2010 by Ximan (Talk | contribs) (Created page with "== Calling Pattern == Call local i = sl.iterator(a,b[, c[,...]]) -- later local r = i.run(arg[, ...]) Args arg0..argN are variadic arguments of any type Results r is a table...")
Calling Pattern
Call
local i = sl.iterator(a,b[, c[,...]]) -- later local r = i.run(arg[, ...])
Args
arg0..argN are variadic arguments of any type
Results
r is a table
Example Usage
Description
Run supplies each key and value in a to b in turn, as well as all static arguments (c0...cN) passed to the iterator constructor, as well as all run arguments (arg0...argN). E.g.:
r_i = b(akey_i,aval_i,c0...,cN,arg0...argN) r = {r0, ... ,rN}
Upon Error
If a non-function (or table with a non-function entry) was passed to the iterator constructor as the second argument, then an error will be raised when it is encountered during run(). Error is reported and handled according to the operant error redirection mode.