The Orc Language#

The pruning combinator seems very inflexible; is there any way to select a publication based on some other criterion than "first"?#

Yes! The pruning combinator's behavior was chosen for its simplicity, but more complicated selection is possible using sites. For example, if you want to select the maximum value published by some expression f() (rather than the first value published):

val c = Buffer()
f() >x> c.put(x) >> stop
; maximum(c.getAll())

Another typical request is to select some subset of values, not just one. For example, here is how you could get all the values published by f() within 1 second (and then terminate f):

val c = Buffer()
repeat(c.get) <<
    f() >x> c.put(x) >> stop
  | Rtimer(1000) >> c.closenb()

These are examples of a general idiom known as "routing", discussed in more detail in the Programming Idioms chapter of the User Guide.

How does Orc handle exceptions or errors?#

Semantically, Orc does not distinguish expressions which fail to yield a value from those which encounter an error. This makes sense in a distributed environment because when a distributed node fails it probably won't have a chance to notify the other nodes. Therefore the standard idiom for handling errors in Orc is to use timeouts or the "otherwise" combinator to detect when an expected publication does not occur and handle it appropriately.

Running Orc programs#

I can't find in the Orc distribution.#

This demo I found on the web site does not work when I try and run it with the Orc interpreter on my computer.#

The Orc distribution includes only the standard library for Orc. Many of the demos on the website need additional sites which are not included in the standard library. The implementations of these additional sites and the corresponding include files are found in Subversion:

various web services and demo sites which do not require a web server, including search engines, Google Calendar, SMTP/IMAP/POP3 email, algorithmic animation, simple GUI tools, etc.
demo sites which do require a web server, including web forms and direct receipt of email. These sites can only be used when running Orc programs via the web interface. Most users will not need to run these sites locally, but if you do, see HowToInstallOrchard for information on how to set up your own local Orc Web service.

Building Orc#

I am getting a build error trying to compile Orchard (or OrcSites). Help!#

Please check the following before emailing us for help:

  1. You have checked out both OrcScala and OrcSites.
  2. You checked out OrcScala to a project named OrcScala (this is the default).
  3. All of your orc projects are in the same parent directory (this is the default).
  4. You have the latest version of all code from Subversion (select all projects, right click, and choose Team -> Update).
  5. If building Orchard, make sure you have built up-to-date JARs and copied them to Orchard/lib as instructed.
  6. Refresh all directories and do a Build -> Clean to make sure Eclipse isn't confused.

Add new attachment

Only authorized users are allowed to upload new attachments.
« This page (revision-7) was last changed on 07-Mar-2009 12:32 by John Thywissen