Re: handler failure [oops! correction]
Re: handler failure [oops! correction]
- Subject: Re: handler failure [oops! correction]
- From: has <email@hidden>
- Date: Sat, 16 Nov 2002 17:24:38 +0000
Michael Terry wrote:
>
> Darn, I must be making them too easy. ;p
>
>
Watch it, dude, or I'll reveal your true name!
Nooooooo....!
>
> Here's a tougher one: how to remedy the problem?
>
>
>
> The only solution I can think of is making the compiler much more sparing
>
> (or far more intelligent) in what and how it binds at compile-time.
>
>
>
> I've noticed several other variable binding problems with AS, including
>
>this:
[...]
>
>
I thought you were just complaining about handlers forgetting their old
>
context and trying to use the new context.
I was complaining about.... oh heck, I can't even remember. But I bet it
was something good. Yeah.
Gotta keep in shape... <rant><rant><rant>AppleScript<bitch><bitch><bitch>,
etc. Don't worry, even I can't follow me half the time.:)
OK, what I'd like...
1. Consistency and correctness. Whatever way it works, the most important
thing is that it's reliable. If the language allows handler objects to be
moved around, it shouldn't start blowing up due to shortcomings in its own
implementation.
2. Easy-to-do callbacks - probably what coloured my original opinion.
This'd be easiest to do if handlers stay put, but even if they don't then
I'm sure some solution is still possible. Right now you have to wrap the
handler in a script object and pass that, but this isn't always convenient
or practical.
3. Crayons that work well on rubber walls. These ones are no good.
On balance, I'd rather have handlers stay put. And lock down the slots so
they can't be overwritten. Letting them move about isn't a bug, but it's
probably more freedom than is wise to allow. You won't lose anything by
preventing it, and you do make the language a bit simpler and more
foolproof.
The rest of the stuff about scoping problems; well, those are due to the
same [or similar] bug that's causing problems when handlers change context.
AS doesn't do static bindings very well: it misses some cases, and causes
inconvenience in others. If the bindings were more dynamic, this wouldn't
be a problem (and perhaps a bit of clever coding would allow normally
static bindings to rebind themselves whenever relationships change, giving
all the flexibility of dynamic bindings without losing the performance
benefits of static ones). In retrospect I think that was probably something
I should've hived off into its own thread though, so sorry for any
confusion caused.
Cheers,
has
--
http://www.barple.pwp.blueyonder.co.uk -- The Little Page of AppleScripts
_______________________________________________
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.