Walnut/Distributed Computing/Multiway when-catch

From Erights

Revision as of 17:41, 10 June 2007 by FwaH24 (Talk)
Jump to: navigation, search

cheap diazepam cheap xenical nokia ringtones qwest ringtones zanaflex online diazepam online verizon ringtones free motorola ringtones order lortab prozac online ericsson ringtones but ortho cheap cyclobenzaprine cheap celexa free ringtones phentermine free cool ringtones cheap prozac free qwest ringtones cialis online sprint ringtones nexium online real ringtones sagem ringtones tracfone ringtones free nokia ringtones free punk ringtones mp3 ringtones sony ringtones ativan online but hgh free midi ringtones alltel ringtones cheap flexeril sony ericsson ringtones motorola ringtones vicodin online free tracfone ringtones buy soma levitra online free motorola ringtones cheap didrex cheap sildenafil pharmacy online online zoloft online hydrocodone online free sony ringtones cingular ringtones viagra buy paxil ambien online buy lortab order hydrocodone vigrx online cheap ativan hgh online sildenafil online buy viagra ortho online nextel ringtones lisinopril free funny ringtones free sony ericsson ringtones buy vicodin hydrocodone order ativan mono ringtones clonazepam levitra free sprint ringtones cialis online sony ringtones cheap levitra zanaflex online phentermine celexa online ultracet online wwe ringtones free sharp ringtones buy norco soma online cheap ultracet free cingular ringtones cheap adipex cheap xenical cheap albuterol cheap tenuate cheap ortho free music ringtones sagem ringtones cheap lisinopril meridia online cheap propecia cheap vigrx cheap diethylpropion cheap albuterol mp3 ringtones meridia online free ringtones cheap ultram soma online cheap lortab cheap sildenafil free nextel ringtones cheap lorazepam free funny ringtones diethylpropion online free ringtones funny ringtones cingular ringtones cheap soma nokia ringtones clonazepam online zyban online clomid online buy prozac online valium order lisinopril meridia online buy tramadol sharp ringtones free midi ringtones flexeril online real ringtones celexa online zoloft online free nextel ringtones ericsson ringtones free music ringtones mtv ringtones order ultram buy valium viagra online lorazepam online cheap cialis cheap phentermine buy nexium samsung ringtones cheap norco meridia online sprint ringtones buy rivotril order carisoprodol carisoprodol online cyclobenzaprine online free qwest ringtones free qwest ringtones cheap fioricet verizon ringtones punk ringtones cheap hoodia pharmacy online online tracfone ringtones tramadol cheap rivotril tramadol online didrex online cheap fioricet music ringtones cheap albuterol free nokia ringtones buy viagra buy alprazolam buy xenical pharmacy online online free funny ringtones order zanaflex free ericsson ringtones cyclobenzaprine online adipex online cheap xanax free alltel ringtones free qwest ringtones ultram online sonyericsson ringtones free samsung ringtones cheap lortab free mono ringtones free samsung ringtones zyban online cheap celexa free funny ringtones wwe ringtones cheap rivotril but clomid buy fioricet buy hgh cheap lipitor cheap hoodia clonazepam online cool ringtones tenuate online cheap vicodin real ringtones free sonyericsson ringtones buy hoodia buy tramadol nextel ringtones cheap alprazolam ambien online

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.

Pass By Construction and Pass By Proxy, References Far and Near

In the above example, the temperature is an integer and is guaranteed to resolve to a local integer object upon which you can make immediate calls, even if the car is remote. Transparent immutable objects, such as integers, floating point numbers, booleans, strings, and the E data structures ConstLists and ConstMaps, are always passed by copy(which is the most common form of Pass By Construction), so you always get a local copy of the object on resolution if one of these is returned by a method call or send. This local copy can of course accept immediate calls.

Mutable objects, like the car in this example, reside on the machine upon which they were constructed. Such an object is passed by proxy. If such an object is on a different machine from the one on which your piece of the system is running, even when the promise resolves it will only resolve into a far reference (as opposed to a near reference for a local object). Far references accept eventual sends, but cannot accept immediate calls.

So in general, if you created the car using an eventual send to a possibly remote object (a receiver), you would probably have to interact with the car using eventual sends forever, since only such sends are guaranteed to work with remote objects.

 # E syntax
 def carRcvr := carMakerRcvr <- ("Mercedes")
 carRcvr <- moveTo(2,3)
 carRcvr <- moveTo(5,6)
 carRcvr <- moveTo(7,3)
 def fuelVow := carRcvr <- fuelRemaining()

Personal tools
more tools