Re: Passing *possible* variables to a handler
Re: Passing *possible* variables to a handler
- Subject: Re: Passing *possible* variables to a handler
- From: "Arthur J. Knapp" <email@hidden>
- Date: Tue, 16 Jul 2002 10:40:34 -0400
>
Date: Mon, 15 Jul 2002 10:46:11 +0100
>
From: has <email@hidden>
>
Subject: Re: Passing *possible* variables to a handler
>
1. I stumble across something vaguely interesting and mention it to the list.
How do you do this, by the way ?!?!?!
>
2. Straightaway Arthur lets out a mighty "Woo-Hoo!" and immediately cooks
>
up a hundred brilliant and terrifying uses for it.
Woo-Hoo, that's not true. (I wonder what would happen if a script object
tried to sub-class itself...) ;-)
script o
property parent : o
>
3. A day or so later, Chris N. posts to the list declaring it a known bug
>
exploit and threatening to patch it in the next release.
At least for the time being, I am fairly immune to having to deal with
the "next release" of anything.
>
4. Arthur makes big puppy-dog eyes at Chris, who relents.
That, and a few thousand dollars...
>
5. Realising the awful mistake I've made ever mentioning the thing, I don
>
sackcloth and ashes and spend the rest of my days wandering the list,
>
yelling "Hackish Kludge Considered Harmful!" at anyone I can corner.
Or "Hamish Kludge..." ;-)
>
6. The rest of the world pays absolutely no heed to any of it, and
>
continues about its business exactly as before.
>
> 3) And finally - I have occasionally used the Serge technique in a handler
>
> which itself is revisited many times in the main script's repeat loop. As
>
> far as i can see, that means I'm having to constantly re-initialize the
>
> embedded script object a zillion times. Would this be a situation where the
>
> script object in the handler could just be initialized once and its values
>
> (the list which forms its own property) replaced a zillion times instead?
Nigel Garvey did some tests, (off list), in which he showed that
repeatedly creating a script object inside a handler like this:
on theHandler( theValue )
script obj
property aProperty : theValue
end script
-- stuff
end theHandler
did not seem to take up any excessive amount of time, ie: there does not
appear to be any major reason to create objects outside of the context
of where they are needed. (I'm sure there would be lots of exceptions to
this, however).
>
That's all OOD is, after all: just another tool for managing the infernal
>
complexity of programming tasks a little more easily [hopefully!;].
Right. :)
{ Arthur J. Knapp, of <
http://www.STELLARViSIONs.com>
a r t h u r @ s t e l l a r v i s i o n s . c o m
}
_______________________________________________
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.