>- Open Your Mind -<



Quoting from Elan's message (22-Jul-00 00:46:33).

r> Certainly the two x's are bound in different contexts. The first 'x in
r> fun1's context and the second 'x in fun2's context. Given that each 'x is
r> bound in a different context, and the context of both x's is extended by
r> appending them to the block blk, reduce [x x] returns the block [2 1],
r> demonstrating that each of the two x's retained their binding, and
r> therefore each 'x evaluates to the value it is associated with by virtue of
r> being bound bound in the context of the function it is associated with. 

OK, maybe... and I *do* mean *maybe*... I have a suggestion for RT: jot down a 
quick-and-dirty native function that prints or probes the elements of anything you 
pass as a parameter *and* their contexts/bindings/scopes/whatever. Er... even I don't 
know if what I just wrote makes any sense... but I conjecture a context, in the end, 
is nothing more than a pointer to some memory area... something that can be printed.
To use the quoted example above, we could get something like the following.

    >> probe-context blk
    [x@1642536 x@1849732]
    == [x x]

    >> probe-context alpha
    alpha@1642536
    == 100

    >> probe-context beta
    beta@1849732
    == 200

    >> probe-context gamma
    gamma@2204972
    == 300

In the example, we read that the first 'x in blk is bound to its value in the same 
context where 'alpha is bound to 100, while the second 'x and' beta belong to another 
context and 'gamma belongs to a third context. How those contexts were created is, as 
we say over here, another pair of sleeves...

This way, whenever a context-related dilemma pops out, we can sort it out rapidly and 
efficiently. Obviously, this would primarily be a debugging/didactic tool. Right now I 
can't think of one single non-insane standard application where this could be useful. 
But I believe almost every doubt posted on this list until now could have been solved 
by using such means (limited and barbarous as they may be :-)




Alessandro Pini ([EMAIL PROTECTED])

"I never thought Vulcans had... much of a knack for improvising." "Our circumstances 
seem to require a certain flexibility." "You could say that!" (Chakotay & Tuvok)

Reply via email to