Walnut/Distributed Computing/Multiway when-catch

From Erights

Revision as of 20:49, 17 December 2008 by 170.35.208.23 (Talk)
Jump to: navigation, search


Multiway when-catch

If you need to resolve several references before making a computation, use a multiway when-catch, in which you specify several arguments in the structure:


 # E syntax
 def maxTempVow := vehicleSpecsRcvr <- getMaxEngineTemperature(carType)
 def engineTempVow := carRcvr <- getEngineTemperature()
 when (engineTempVow,maxTempVow) -> {
     if (engineTempVow > maxTempVow) {println("Car overheating!")}
 } catch e {println(`Lost car or vehicleSpecs: $e`)}

In this when-catch, since all the arguments are vows, the corresponding parameters (engineTemp and maxTemp, to the right of the "->") are simply local objects (integers in this case). How do we know that these integers will be local, not remote, even though we retrieved them from Rcvrs? Because integers are passed by construction, as discussed next.

FIELD_MESSAGE_ercboccaorg

Personal tools
more tools