Re: Library Modules and Library Loaders
Re: Library Modules and Library Loaders
- Subject: Re: Library Modules and Library Loaders
- From: 栗田 哲郎 <email@hidden>
- Date: Sat, 04 Sep 2010 08:19:33 +0000 (UTC)
I' m sorry for my poor language ability.
The instance I mean is a script object loaded from a file.
Consider following veritual code:
set C1 to import "C"
set C2 to import "C"
set is_single to C1 is C2
Your "import" command must have ability to make is_single be true.
Normal osax command implementation cause is_single is false.
Only this behavior will not enough for serias library loader.
I can't belive to implement serious library loader without helps of a script object.
It looks you try to implement a better "load module" command which is an extra of ModuleLoader.
T.Kurita
3日 10:02PM、Philip Aker <philip.aker@shawca>のメッセージ:
On 2010-09-02, at 09:12:48, Tetsuro KURITA wrote:
>> In the application and osax projects in ModuleManager.framework, I show that a library is assigned a unique id when it is created. It will be the same for scripts and other kinds of files registered with ModuleManager. It's 'import' command will know if it's already loaded a script with a particular unique id, and can make the choice whether or not to create a new instance.
> Script object returned form an OSAX command have independent instance each others.
> I have already tried it. Your plan will be impossible.
> Do you know a way to make OSAX command return a script object whose instance is same to the one of the loaded script.
Hi Tetsuro,
I'm having trouble with your phrasing because 'instance' is a big word in OSA technology. Are you talking about 'ComponentInstance' or the situation where script A imports script C and script B also imports script C?
What I'm talking about for an 'import' handler is that when it's supplied with a file to import, then it can know whether or not it is called to import that file a second time and have the choice about whether or not to load it again. That is, if I don't want to load script C a second time, I will return a valid but empty result.
What will be the net result? I think that only one instance of script C will have been loaded and it's handlers will be the ones that are called. Because an osax is a plugin to a component, then whenever a new instance of the component is created, then it necessarily loads a new instance of the osax.
Philip Aker
echo email@hidden@nl | tr a-z@. p-za-o.@
Democracy: Two wolves and a sheep voting on lunch.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden