[e-lang] PassByConstruction is now available for E objects (almost)

Kevin Reid kpreid at mac.com
Mon Jan 8 08:04:25 CST 2007


I have just checked in support for uncall-based PassByConstruction.  
This means that you can write E objects which are passed by  
construction.

However, the utility needed for reconstructing objects passed as code  
does not yet exist, so you can't send arbitrary objects yet.

(MarkM: I just remembered that the CapTP bug we were looking at is  
actually incidental; real PBC does not involve the sending instance  
having references specific to the recipient. The problem is that  
__eval isn't implemented, and no other evaluation service that I know  
of accepts a ConstMap rather than a (not constructable from the  
safeScope) Scope.)

Here's an updoc script showing what can be done so far:

     ? pragma.syntax("0.9")

     ? def vsv := <elang:interp.seedVatAuthor>(<unsafe>).virtualize(
     >              (introducer.onTheAir(); introducer))
     # value: <virtualSeedVat>

     ? def [other, vat] := vsv("fn x { x }")
     # value: [<Promise>, <Vat newVirtualSeedVat in <runs in  
newVirtualSeedVat>>]

     ? def obj implements pbc { to __optUncall() :any {
     >   return [<elib:tables.makeFlexList>, "make", []]
     > }}
     # value: <obj>

     ? Ref.isPBC(obj)
     # value: true

     ? Ref.isPassByCopy(obj)
     # value: false

     ? obj :pbc
     # value: <obj>

     ? def r := interp.waitAtTop(other <- (obj))
     # value: <Remote Promise>

     ? r
     # value: <Far ref>

     ? r <- push(1)
     # value: <Remote Promise>

     ? r <- push(2)
     # value: <Remote Promise>

     ? def s := interp.waitAtTop(r <- snapshot())
     # value: <Remote Promise>

     ? s
     # value: [1, 2]

-- 
Kevin Reid                            <http://homepage.mac.com/kpreid/>


-- 
Kevin Reid                            <http://homepage.mac.com/kpreid/>




More information about the e-lang mailing list