[cap-talk] Lua, Javascript, and the Object Capability Model

David-Sarah Hopwood david-sarah at jacaranda.org
Mon Jul 27 20:25:22 EDT 2009


Tony Finch wrote:
> On Mon, 27 Jul 2009, Matej Kosik wrote:
>> Suppose that you have two separate confined subsystems and one has
>> access to a function defined in another one. The following two questions
>> might be silling but I would like to ask anyway:
>>
>> (1) Can the first subsystem pass a reference to its private object to
>> another subsystem as a parameter to a function call?
>>
>> (2) Can the second subsystem return a reference to its private object to
>> the first subsystem as a return value?
> 
> Yes, in both cases, if the private object is implemented as a table.

Right.

> You can also implement objects in Lua as closures, in which case the
> answers are no, in both cases.

Why not? I wasn't aware of any restrictions on the "first-classness" of
closure values in Lua.

-- 
David-Sarah Hopwood  ⚥  http://davidsarah.livejournal.com



More information about the cap-talk mailing list