[EMAIL PROTECTED] wrote:
>
> On 12/27/1999 at 1:15 PM [EMAIL PROTECTED] wrote:{{
> It seems clear that context-juggling is implicitly performed via
> entry and exit to the bodies of functions and 'use, as in:
> >> a: "global a"
> == "global a"
> >> f: func [][print a]
> >> g: func [/local a][a: "g's local a" print a f print a]
> >> h: func [][use [a][a: "h's local a" print a g print a]]
> >> h
> h's local a
> g's local a
> global a
> g's local a
> h's local a
> >>
> }}
>
> So, how is this any different than something like (it's been a while):
>
> var a: string;
>
> procedure g;
> var a: string;
> begin a:= "g's local a"; write (a) end;
>
> procedure h;
> var a: string;
> begin a:= "h's local a"; write (a); g; write (a) end;
>
> begin a:="global a"; h end.
>
> -Ted.
(It's been a while since I've dealt with Pascal, too! However, I
think I remember enough to understand your example. ;-)
In terms of the behavior of this simple example, the results
(printed output) are similar. The differences (actual behaviors
by which the outputs are produced) are huge.
In the standard implementation model, Pascal local variables are
allocated on the stack upon entry to a procedure, and deallocated
upon exit from the procedure. There's no way to make a local
var from one procedure refer to the content of a local var from a
different procedure (except via pointers, and then one gets into
the danger of the "dangling reference" problem).
OTOH, by using 'bind it IS possible to make the word/value
association that exists within one context available to another.
That's a very large difference, IMHO.
-jn-