<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://www.easyuo.com/openeuo/wiki/index.php?action=history&amp;feed=atom&amp;title=Chain.initiate</id>
		<title>Chain.initiate - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://www.easyuo.com/openeuo/wiki/index.php?action=history&amp;feed=atom&amp;title=Chain.initiate"/>
		<link rel="alternate" type="text/html" href="http://www.easyuo.com/openeuo/wiki/index.php?title=Chain.initiate&amp;action=history"/>
		<updated>2026-06-15T15:44:45Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.26.3</generator>

	<entry>
		<id>http://www.easyuo.com/openeuo/wiki/index.php?title=Chain.initiate&amp;diff=1146&amp;oldid=prev</id>
		<title>Ximan: Created page with &quot;== Calling Pattern == Call  local c = sl.chain(a,b[,...])  -- later  local i,j = chain.initiate([d[,...]]) Args  d1..dN optional are variadic arguments of any type Results  i is ...&quot;</title>
		<link rel="alternate" type="text/html" href="http://www.easyuo.com/openeuo/wiki/index.php?title=Chain.initiate&amp;diff=1146&amp;oldid=prev"/>
				<updated>2010-12-18T23:59:22Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;== Calling Pattern == Call  local c = sl.chain(a,b[,...])  -- later  local i,j = chain.initiate([d[,...]]) Args  d1..dN optional are variadic arguments of any type Results  i is ...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Calling Pattern ==&lt;br /&gt;
Call&lt;br /&gt;
 local c = sl.chain(a,b[,...])&lt;br /&gt;
 -- later&lt;br /&gt;
 local i,j = chain.initiate([d[,...]])&lt;br /&gt;
Args&lt;br /&gt;
 d1..dN optional are variadic arguments of any type&lt;br /&gt;
Results&lt;br /&gt;
 i is a number&lt;br /&gt;
 j is a number&lt;br /&gt;
&lt;br /&gt;
== Example Usage ==&lt;br /&gt;
&lt;br /&gt;
 local b01 = function(n,...)&lt;br /&gt;
  print(n)&lt;br /&gt;
  return true&lt;br /&gt;
 end&lt;br /&gt;
 local b02 = function(a,b,c)&lt;br /&gt;
  print(a..' '..b..' '..c)&lt;br /&gt;
  return string.char(string.byte(a)+1), string.char(string.byte(b)+1), string.char(string.byte(c)+1)&lt;br /&gt;
 end&lt;br /&gt;
 local b05 = {b02,b02,b02}&lt;br /&gt;
 local b00 = sl.chain(b01,b05)&lt;br /&gt;
 local b03, b04 = b00.init('a','b','c')&lt;br /&gt;
 print(b03)&lt;br /&gt;
 print(b04)&lt;br /&gt;
 b00.dispose()&lt;br /&gt;
&lt;br /&gt;
 --&amp;gt; a b c&lt;br /&gt;
     1&lt;br /&gt;
     b c d&lt;br /&gt;
     2&lt;br /&gt;
     c d e&lt;br /&gt;
     3&lt;br /&gt;
     3&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
Calling initiate begins the execution of a previously defined chain object.  Each function in the chain body (b1..bN) is called with a set of variadic arguments in turn.  The first set of arguments are the arguments supplied to the initiate call.  The next set of arguments is the output of the first body function, and so on.  The body index and output of each function is fed to the monitoring function, a, and if a returns true, the next function in the body is called and so on, until the end of the chain is reached.  Initiate returns a [[tuple]] of the number of body functions executed and the total number of body functions. &lt;br /&gt;
&lt;br /&gt;
== Upon Error ==&lt;br /&gt;
&lt;br /&gt;
Errors occurring in any of the chained functions are reported and handled according to the operant error redirection mode.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [http://www.easyuo.com/openeuo/wiki/index.php/Simplelib simplelib]&lt;br /&gt;
&lt;br /&gt;
* [[case]]&lt;br /&gt;
* [[chain]]&lt;br /&gt;
* [[chain.dispose]]&lt;br /&gt;
* [[iterator]]&lt;br /&gt;
* [[machine]]&lt;br /&gt;
* [[spin]]&lt;/div&gt;</summary>
		<author><name>Ximan</name></author>	</entry>

	</feed>