11.5. reflect: Metalanguage operations.

Metalanguage operations.

11.5.1. MakeSite

site MakeSite[A](A) :: A

This site promotes an Orc closure to a site; when the site is called, the closure is executed on those arguments. This execution behaves like a site call; in particular, the following four properties hold:

  • The site, like all sites, is strict in its arguments.

  • The site returns only the first value published by the executed closure. The closure continues to run, but its subsequent publications are discarded.

  • The execution of the closure is protected from being killed. If the site call is killed, the closure still runs, and its publications are simply ignored.

  • If the execution of the closure halts, so does the site call.

The typical usage of MakeSite looks like:

def foo(...) = ...
val Foo = MakeSite(foo)

The typing of MakeSite enforces the additional condition that the type A is a function type.