[e-lang] simple question

Kevin Reid kpreid at mac.com
Thu Aug 17 11:31:37 EDT 2006


On Aug 17, 2006, at 7:01, Matej Kosik wrote:
> Kevin Reid wrote:
>>    ? def object := program.eval(safeScope)
>>    # value: <programWithoutAuthority>
>
> I guess that the above command's semantics is that it evaluates a  
> given
> program inside current vat. That is, it does not create a new vat.
>
> Is there a possibility to instantiate new vat (separate from the one
> from which that command would be executed) for a given program in  
> such a
> way that:
> 1. the new vat will have initially no capabilities to external objects
> 2. the new vat tells the its "parent" what its "main object" is ...
> 3. and thus parent may deliver it all the capabilities to the outside
> world the new vat needs, or tells other peers about this new vat so  
> that
> they send it requests (as messages) which convey proper  
> capabilities so
> that this new vat can do some useful work?

Yes. Everything is the same as before, except that you create a vat  
to do the eval in.

? def seedVat := <elang:interp.seedVatAuthor>(<unsafe>)
# value: <seedVat>

? def [remote, vat] := seedVat("
 >   def boot(program) { program.eval(safeScope) }
 > ")
# value: [<Remote Promise>, <Vat newSeedVat in <runs in newSeedVat>>]

? remote <- run(program)
# value: <Remote Promise>

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




More information about the e-lang mailing list