On Thu, Aug 4, 2011 at 12:10 AM, BGB <[email protected]> wrote:

> The new thread should inherit the entire dynamic scope - logically, a local
>> copy thereof. If there are object references mixed in, then the new thread
>> now has a copy of these references, but the reference variables initially
>> point to shared objects.
>
>
> they would inherit the entire dynamic scope directly, but the issue would
> be that dynamic variables which were not re-declared would likely be shared
> with the parent (and so couldn't be modified without effecting the parent).
>

I had used 'copy on write' in a sort of continuation passing style.
Performance did not suffer.


>
> dynamic scope has a lower priority than lexical scope though (and a lower
> priority than object/class scope), so if any lexically visible bindings
> exist, they will be bound against first.
>
> technically, dynamic scope is just just prior to doing a full brute-force
> search (following delegation chains, tracing through packages, seeing if the
> C FFI knows about it, ...).
>

I would prefer dynamic scope to be explicit. Lisp tagged special vars with a
'*' - e.g. you could ask for something like '*x' to get the dynamically
scoped x. I had used a keyword to extract the full record of dynamic
variables (to support various security idioms).

Your idea of searching for variables in non-local scopes sounds horribly
broken. Dynamic scope and objects can replace use of globals and control
access to FFI. It is much easier to mock up a test environment, or provide a
sandbox, when you control the context.
_______________________________________________
fonc mailing list
[email protected]
http://vpri.org/mailman/listinfo/fonc

Reply via email to