[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: dynamic bindng
Date: Tue, 12 Dec 89 13:10:43 EST
From: "Michael R. Blair" <ziggy@hx.lcs.mit.edu>
I use FLUID-LET to dynamically rebind environmnent variables, like
*debugging?* *alpha-rename* *found-an-error?*... things that look like
they could be arguments but which would have to be included in every
procedure of a complex module so the info could propagate and percolate
to those few procedures which actually use them.
If you view a module as an object in the Object-Oriented sense, these
effectively correspond to modifiable instance variables.
It sounds like you may have the basic idea. Consider: if you are
debugging the methods of a class, you can have instance variables such
as you mention; you can have one instance of the class in which these
instance variables are bound to "experimental" values, and other
instances in which they are bound to "sane default" values. You can
debug using the former, while your system performs its normal operations
using the latter.
Again, I use FLUID-LET (which I hope uses dynamic-unwind) to reset
my state to a sane default if/when I blow out into the debugger
and abort.
By the way, what I was alluding to whith my reference to exception
handling was that something like (SIGNAL over-flow "Overflow on
arg to SQUARE" arg) will invoke something which depends non who the
dynamic caller to SQUARE was. It involves dynamically binding a
handler that the callee invokes upon error (default is "the no handler
handler"). This is the classic way that exception handling is presented
in a denotational sematics setting (namely, bind a handler continuation
in a dynamic environment.
Exception handler binding is, certainly, the weak point in my proposal.
I *think* it would make sense to use the lexical approach for exception
handlers as well, but I confess I haven't given this as much thought as
for other uses of dynamic binding, and I have a much harder time
defending my proposal against someone who claims that these simply are
dynamic by nature.
Hmm... let me mull this one over further.
-- Scott