Page:Scheme - An interpreter for extended lambda calculus.djvu/14



A Useless Multiprocessing Example
One thing we might want to use multiprocessing for is to try two things in parallel, and terminate as soon as one succeeds. We can do this with the following function.

takes two functions of no arguments (in order to pass an unevaluated expression and its environment in for later use, so as to avoid variable conflicts). It creates two processes to run them, and returns the value of whichever completes first.

As an example of how to misuse, here is a function which determines the sign of an integer using only  ,  , and.