Re: handler failure
Re: handler failure
- Subject: Re: handler failure
- From: email@hidden (Michael Sullivan)
- Date: Thu, 14 Nov 2002 15:14:18 -0500
- Organization: Society for the Incurably Pompous
On Wednesday Paul Skinner wrote:
>
I certainly don't think that it should be expected that a handler
>
plucked from it's environment should 'remember' how things used to be
>
'back on the farm script' so to speak.
Oh, but I do. It's called lexical scoping, and IIRC, applescript claims
to have it. Literally it means that the scope of variables is defined
by the block where they are introduced in the text of the source code,
*not* the block they happen to be in when called.
If set copies a reference (as it claims to for anything as complex as a
handler), then the scoping should work properly. b's bar, becomes a
reference that points to "a's foo" which is lexically part of script a,
and so should have script a as it's scope.
>
Think of the implications of
>
objects carrying around all that baggage. think what would happen if
>
you then make another iteration.
Actually, it's equally complicated to implement dynamic scoping in any
semi-consistent fashion, and debugging becomes much more difficult
(which is why lexical scope has pretty much taken over). With lexical
scoping you always know the scope of a variable by looking at the source
code. With dynamic scope, you have to trace the actual call pattern to
know the scope of your variables.
Michael
--
Michael Sullivan
Business Card Express of CT Thermographers to the Trade
Cheshire, CT email@hidden
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.