Subject: Re: Dynamic bindings and lightweight processes
From: Erik Naggum <erik@naggum.no>
Date: 2000/03/03
Newsgroups: comp.lang.lisp
Message-ID: <3161081138993119@naggum.no>

* Tim Bradshaw <tfb@cley.com>
| I think the wrongness is to assume that SYMBOL-VALUE gets at the `slot in
| the symbol', which is something I used to think.  In fact it gets at the
| current dynamic binding -- there is no portable way to get at the slot in
| the symbol -- and indeed there may *be* no distinct symbol slot, but just
| a top-level binding.

  if the current dynamic value of a special variable and symbol-value of
  the symbol _differ_ (modify one, don't see the difference in the other),
  you have a seriously non-conforming implementation, so _the_ portable way
  to get at the slot in the symbol cannot be any different than the current
  dynamic value.  please don't confuse this issue beyond necessity.

  there are two ways to do this dynamic binding thing: shallow and deep
  binding.  shallow binding stuffs the old value away, typically on the
  same stack that unwind-protect uses, and stores the new value in the
  symbol-value slot.  deep binding basically pushes symbols on an alist (or
  something very similar) and traverses it to get the current value.  in a
  multiprocessing setting, there are multiple stacks, and at least one of
  them is used to store the process-local value of symbol-value slots of
  process-bound special variables.

  this is actuall fairly well documented in each of the Common Lisp systems
  that support multiprocessing.

#:Erik