[e-lang] ref_send API v1.0
Tyler Close
tyler.close at gmail.com
Sat Jun 9 17:55:01 EDT 2007
I've updated the ref_send API to reflect the Joe-E v1.0 API and stamped it 1.0.
The 1.0 release means backwards compatibility will be maintained and
so the API provides a stable base upon which to build capability-based
Java applications.
I also added another small example to the release, a tail recursive
factorial implementation. This example shows how ref_send supports the
functional programming paradigm. The main body of the implementation
is:
static public Promise<Integer>
factorial(final Eventual _, final int n) {
if (n < 0) { return new Rejected<Integer>(new Exception()); }
final Recursion loop_ = _._(new Recursion() {
public Promise<Integer>
run(final Recursion loop_, final int n, final int acc) {
if (n == 0) { return ref(acc); }
return loop_.run(loop_, n - 1, n * acc);
}
});
return loop_.run(loop_, n, 1);
}
This code is busier than a Scheme programmer would like, but I think
the algorithm is still clear, and more importantly, it's written in
Java, making the technique available to Java programmers.
The ref_send 1.0 download is at:
http://waterken.sourceforge.net/download.html
and the Javadoc is at:
http://waterken.sourceforge.net/javadoc/
Tyler
--
The web-calculus is the union of REST and capability-based security:
http://www.waterken.com/dev/Web/
Name your trusted sites to distinguish them from phishing sites.
https://addons.mozilla.org/firefox/957/
More information about the e-lang
mailing list