1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/1998/REC-html40-19980424/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Y</title>
<link rel="stylesheet" href="doc.css" type="text/css">
</head>
<body>
<h1>Y</h1>
<dl>
<dt><a name="yield"><code>(yield 'any ['sym]) -> any</code></a>
<dd>(64-bit version only) Transfers control from the current <a
href="ref.html#coroutines">coroutine</a> back to the caller (when the
<code>sym</code> tag is not given), or to some other coroutine (specified by
<code>sym</code>) to continue execution at the point where that coroutine had
called <code>yield</code> before. In the first case, the value <code>any</code>
will be returned from the corresponding <code><a
href="refC.html#co">co</a></code> call, in the second case it will be the return
value of that <code>yield</code> call. See also <code><a
href="refS.html#stack">stack</a></code>, <code><a
href="refC.html#catch">catch</a></code> and <code><a
href="refT.html#throw">throw</a></code>.
<pre><code>
: (co "rt1" # Start first routine
(msg (yield 1) " in rt1 from rt2") # Return '1', wait for value from "rt2"
7 ) # Then return '7'
-> 1
: (co "rt2" # Start second routine
(yield 2 "rt1") ) # Send '2' to "rt1"
2 in rt1 from rt2
-> 7
</code></pre>
<dt><a name="yoke"><code>(yoke 'any ..) -> any</code></a>
<dd>Inserts one or several new elements <code>any</code> in front of the list in
the current <code><a href="refM.html#make">make</a></code> environment.
<code>yoke</code> returns the last inserted argument. See also <code><a
href="refL.html#link">link</a></code>, <code><a
href="refC.html#chain">chain</a></code> and <code><a
href="refM.html#made">made</a></code>.
<pre><code>
: (make (link 2 3) (yoke 1) (link 4))
-> (1 2 3 4)
</code></pre>
</dl>
</body>
</html>
|