Re: hash arrays and other mysteries
Re: hash arrays and other mysteries
- Subject: Re: hash arrays and other mysteries
- From: has <email@hidden>
- Date: Mon, 22 Oct 2001 15:29:00 +0100
Greg Strange wrote:
>
>> Import (would) add new handlers to your script object. Load script add
>
>> new
>
>> objects to your script object.
>
>>
>
> SNIP
>
>> Tim
>
>
>
> Then what you want is available in vanilla AppleScript. The parent
>
> property
>
> adds handlers from the parent script into your child script. No tell
>
> object
>
> machinations required.
>
>
>
>
We were discussing this over on the applemods list. The only problem
>
with this is that if the loadable script changes in the future then the
>
updated handlers won't be available to your script because as a property
>
it will keep static between runs. You would have to open each script
>
and recompile to get the updated handlers.
Also, you can only have one parent property in a script. If you want a
convenient way to import handlers from multiple files it won't cover that
either.
I have the impression that 'import' in languages like C also imports stuff
at compile time only, not at the start of each runtime. I'm also assuming
that using "property parent" causes the parent's handlers & properties to
be compiled as part of your script once you hit the "check syntax" button.
But what you're proposing is an import command that will, at every runtime,
import the handlers and properties of the target script, and then make
those available directly as they would be if a parent property had been
used?
From the user's point of view (convenience) it'd seem to make a lot of
sense. Although in OO terms it sounds like a bit of dirty trickery. What
the hey; I still think it could be worth bending the rules for.
Only, don't you think the Gods of OO will strike us down for making such a
heretical request...?:)
has