source: project/futures/futures.html @ 3

Last change on this file since 3 was 3, checked in by felix winkelmann, 14 years ago

udp/test-infrastructure changes; added futures

File size: 6.8 KB
Line 
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2<!-- Generated by eggdoc Revision: 1.17  -->
3<html>
4<head>
5<title>Eggs Unlimited - futures</title><style type="text/css"> <!--
6      CODE {
7            color: #666666;
8          }
9/*   DT.definition EM { font-weight: bold; font-style: normal; } */
10
11     DT.definition { 
12                   background: #eee;
13                   color: black;
14                   padding: 0.2em 1em 0.2em 0.7em;
15                   margin-left: 0.2em;
16border: 1px solid #bbc;
17                   font-family: "Andale Mono", monospace;
18                   /* font-size: 1.2em; */
19                   
20                 }
21     DD {
22                   margin-top: 0.8em;
23                   margin-bottom: 0.8em;
24     }
25     DIV.subsection {
26                    border-top: 1px solid #448;
27                    padding-left: 1em;
28     }
29         DIV.section {
30                 margin-bottom: 1.5em;
31         }
32         a:link {
33                 color: #336;
34         }
35         a:visited { color: #666; }
36         a:active  { color: #966; }
37         a:hover   { color: #669; }
38         body { margin: 0; padding: 0; background: #fff; color: #000; font: 9pt "Lucida Grande", "Verdana", sans-serif; }
39         H2 {
40                 background: #336;
41                 color: #fff;
42                 padding-top: 0.5em;
43                 padding-bottom: 0.5em;
44                 padding-left: 16px;
45                 margin: 0 0 1em 0;
46        }
47        LI {
48                list-style: none;
49        }
50        TT {
51                font-family: "Andale Mono", monospace;
52                /* font-size: 1.2em; */
53        }
54        H3 {
55                color: #113;
56                margin-bottom: 0.5em;
57        }
58     DIV#eggheader {
59         text-align: center;
60                 float: right;
61                 margin-right: 2em;
62     }
63     DIV#header IMG {
64            /* display: block; margin-left: auto; margin-right: auto;  */
65            /* float: right; */
66            border: none;  /* firefox */
67     }
68     DIV#footer {
69                background: #bbd;
70                padding: 0.7em ;
71                border-top: 1px solid #cce;
72     }
73     DIV#footer hr {
74                display: none;
75     }
76     DIV#footer a {
77                float: left;
78     }
79     DIV#revision-history {
80         float: right;
81     }
82     
83     DIV#body {
84                 margin: 1em 1em 1em 16px;
85         }
86
87     DIV#examples PRE {
88       background: #eef;
89       padding: 0.1em;
90       border: 1px solid #aac;
91     }
92     PRE#license, DIV#examples PRE {
93       padding: 0.5em;
94     }
95     DIV#examples PRE {
96       /* font-size: 85%; */
97     }
98     PRE { font-family: "Andale Mono", monospace; }
99     TABLE {
100       background: #eef;
101       padding: 0.2em;
102       border: 1px solid #aac;
103       width: 100%;
104     }
105     TABLE.symbol-table TD.symbol {
106          width: 15em;
107          font-family: "Andale Mono", monospace;
108          /* font-size: 1.2em; */
109     }
110     TH {
111       border-bottom: 1px solid black;
112     } --></style></head>
113<body>
114<div id="header">
115<h2>futures</h2>
116<div id="eggheader">
117<a href="index.html">
118<img src="egg.jpg" alt="[Picture of an egg]" /></a></div></div>
119<div id="body">
120<div class="section">
121<h3>Description</h3>
122<p>A straightforward implementation of &quot;futures&quot; for concurrent evaluation of expressions.</p></div>
123<div class="section">
124<h3>Author</h3>
125<a href="mailto:felix@call-with-current-continuation.org">Felix</a></div>
126<div class="section">
127<h3>Version</h3>
128<ul>
129<li>1.0 Initial release</li></ul></div>
130<div class="section">
131<h3>Usage</h3>
132<tt>(require-extension futures)</tt></div>
133<div class="section">
134<h3>Download</h3>
135<a href="futures.egg">futures.egg</a></div>
136<div class="section">
137<h3>Documentation</h3>
138<p>This extension provides syntax and data types for
139<i>futures</i> - concurrently evaluated expressions that memoize their result</p>
140<dl>
141<dt class="definition">
142<strong>macro:</strong> (future EXPRESSION)</dt>
143<dd>
144<p>Starts evaluation of
145<tt>EXPRESSION</tt> in a separate thread and returns a
146<i>future</i> object representing the computation.</p></dd>
147<dt class="definition">
148<strong>procedure:</strong> (future? X)</dt>
149<dd>
150<p>Returns
151<tt>#t</tt> if
152<tt>X</tt> is an object returned by a
153<tt>future</tt> expression or
154<tt>#f</tt> otherwise.</p></dd>
155<dt class="definition">
156<strong>procedure:</strong> (force X)</dt>
157<dd>
158<p>If
159<tt>X</tt> is a future, then the current threads waits until the expression evaluated at the point of creating the future is complete. If an error occurred during that evaluation, or when the future executed to completion, then
160<tt>force</tt> will return the result(s) of the future expression.</p>
161<p>If the argument is not a future, then the usual semantics of
162<tt>force</tt> apply.</p></dd>
163<dt class="definition">
164<strong>procedure:</strong> (future-complete? FUTURE)</dt>
165<dd>
166<p>Returns
167<tt>#t</tt> if the future has completed execution, or if an exception occurred during its evaluation, or
168<tt>#f</tt> otherwise.</p></dd>
169<dt class="definition">
170<strong>procedure:</strong> (future-failed? FUTURE)</dt>
171<dd>
172<p>Returns
173<tt>#t</tt> if an exception occurred during evaluation of the future or
174<tt>#f</tt> otherwise.</p></dd>
175<dt class="definition">
176<strong>procedure:</strong> (future-condition FUTURE)</dt>
177<dd>
178<p>Returns the error-condition if an exception occurred during evaluation of the future or
179<tt>#f</tt> if the future is still executing or executed without an error.</p></dd></dl></div>
180<div class="section">
181<h3>License</h3>
182<pre id="license">Copyright (c) 2005, Felix L. Winkelmann.  All rights reserved.
183
184Redistribution and use in source and binary forms, with or without
185modification, are permitted provided that the following conditions are met:
186
187  Redistributions of source code must retain the above copyright notice,
188  this list of conditions and the following disclaimer. Redistributions in
189  binary form must reproduce the above copyright notice, this list of
190  conditions and the following disclaimer in the documentation and/or
191  other materials provided with the distribution. Neither the name of the
192  author nor the names of its contributors may be used to endorse or
193  promote products derived from this software without specific prior
194  written permission.
195
196THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &quot;AS
197IS&quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
198THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
199PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
200CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
201EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
202PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
203PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
204LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
205NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
206SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</pre></div></div>
207<div id="footer">
208<hr />
209<a href="index.html">&lt; Egg index</a>
210<div id="revision-history">$Revision$ $Date$</div>&nbsp;</div></body></html>
Note: See TracBrowser for help on using the repository browser.