• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: handler failure
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: handler failure
      • From: Paul Skinner <email@hidden>
References: 
 >Re: handler failure (From: has <email@hidden>)

  • Prev by Date: Re: handler failure
  • Next by Date: Re: GraphicConverter & saving files in new places
  • Previous by thread: Re: handler failure
  • Next by thread: Re: handler failure
  • Index(es):
    • Date
    • Thread