Re: Library Modules and Library Loaders
Re: Library Modules and Library Loaders
- Subject: Re: Library Modules and Library Loaders
- From: Philip Aker <email@hidden>
- Date: Sat, 4 Sep 2010 05:34:42 -0700
On 2010-09-04, at 01:19:33, 栗田 哲郎 wrote: I' m sorry for my poor language ability.
Hi Tetsuro,
But I have no Japanese language ability. The communications problem is mine. So let's proceed patiently until things are clear.
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.
Ok. I think I see what you mean:
script bob property suit : "Armani" end script set betty to bob
betty = bob --> true --> "Armani"
So one way of looking at this problem is to say that it's wrong to import C to C2 because the user can solve the problem by "set betty to bob". But it's not always that simple because the load commands may be in different script files. Another is by overriding 'load script' (already mentioned several times). Another is by being the actual ComponentInstance that is loading/running/compiling the script.
I think this problem is solvable.
The user can set an import option to get the desired behavior.
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.
What I want is a standard file format for modules. I didn't intend write any code to have this done. I just wanted to discuss with everyone what file format would be good for the most number of scriptors and have every library loader use it. Different editors can edit RTF and many graphic applications can edit PNG, TIFF, and JPG but they all work on a standard file formats. So scriptors should have a standard file format for their libraries.
Now that I've started on the project, I am finding it to be a very interesting area. I don't expect to be working on the osax 'import' command until the version of ModuleManager.framework is greater than 0.7.5. Right now it is only 0.5.2.
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