Re: handler failure
Re: handler failure
- Subject: Re: handler failure
- From: Paul Skinner <email@hidden>
- Date: Wed, 13 Nov 2002 10:31:31 -0500
On Wednesday, November 13, 2002, at 08:35 AM, has wrote:
Chris Espinosa wrote:
A handler is essentially a property in your script, and you can set it
to any value, including that of another function.
Unfortunately, this [undocumented] behaviour has always been broken:
======================================================================
script a
property _val : 1
on foo()
return _val
end foo
end script
script b
property bar : missing value
end script
a's foo()
--> 1
set b's bar to a's foo
b's bar
--> <<handler foo>> --!!!!!
This is correct. You assigned the contents of a's foo (which is the
handler foo) to b's bar. Now b's bar contains the handler foo.
It looks to me like you meant to ...
set b's bar to a's foo()
-->1
b's bar
-->1
But I won't assume that. Nope.
======================================================================
When the handler object moves to a new context, it forgets its original
context (bad) and attempts to use the new one instead (worse). Mix in
some
static bindings for laffs, and you can get some fantastically
incomprehensible results (...).
The results are what I expected. And if they change I'll have to
rewrite some scripts. Just exactly what did you think the contents of
b's bar should be?
Still Chris... now that you've opened Pandora's Box for all to see, any
chance this amnesia problem might be fixed in a future release?
has
--
Paul Skinner
_______________________________________________
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.