Re: Library Modules and Library Loaders
Re: Library Modules and Library Loaders
- Subject: Re: Library Modules and Library Loaders
- From: Tetsuro KURITA <email@hidden>
- Date: Thu, 02 Sep 2010 02:25:48 +0900
On 2010/09/01, at 17:27, Philip Aker wrote:
> On 2010-08-31, at 21:52:31, Tetsuro KURITA wrote:
>
>>> Hi Tetsuro,
>
>>> Do you mean osaxen receiving AppleEvent descriptors like 'object' and 'object specifier'?
>
>> Consider loading two modules (ModuleA and MoudleB) which depending on same module (ModuleC).
>
>> The ModuleC of ModuleA will not share the instance with the ModuleC of ModuleA.
>
>> Also consider following statements.
>
>> set ModuleA to import "ModuleA"
>> set ModuleB to import "ModuleA"
>
>> I expect ModuleA is ModuleB. But loading modules by a simple osax command cause ModuleA is not ModuleB.
>
>>>> There is a reason why both of ModuleLoader and AppleMods load modules through a script object. This mechanism causes complex syntax to load modules.
>>>
>
>>> Yes, and I think, like Takaaki and Ed, that this is one of the reasons that library loaders are not often used. So we have to fix it.
>
>> Do you have any ideas for syntax to load modules and to describe its dependencies ?
>
> I think dependency problems are well studied and have very advanced solutions available these days.
I can't agree with you.
The solution ignoring dependency problems is not useful for me.
> Maybe I could ask about _how_ to solve the problem?
I am interested with simplifying syntax of ModuleLoader.
See following typical code of ModuleLoader.
property ModuleA : module
property ModuleB : module
boot (module loader) for me
I think "boot (module loader) for me" is agree.
If a handler can know the script object which call the handler, "for me" can be removed. If OSAX command can access the script object calling the command, "boot (module loader) for me" can be replaced with a simple command.
I have already given up solving above problems.
> But, I was asking in my previous question:
>
> "What description of libraries provides the most bang for the buck?"
>
> IOW, what information must a library description of a script contain so that you don't get the problems you are asking about? For instance, when a script is registered into a library:
>
> • It can keep a list of a script's handlers and properties.
Who does list a script's handlers and properties ?
What is the purpose of the list of a script's handlers and properties ?
> • It has assigned the script a unique ID.
What is the role of the unique ID. Why can a script be identified with its name ?
> Therefore, if A is imported and A imports C, then, when B imports C, I believe it is the user's choice as to whether or not they want separate instances of C. In either case, we can deal with their choice.
How do you keep single instance of C ? Known solutions are using AppleMods or ModuleLoader. Your 'import' command (simple osax command) can't help to keep single instance of C. I have already tried and gave up. I hope you can find the solution.
=======================================================
Tetsuro KURITA
E-mail: email@hidden
http://homepage.mac.com/tkurita/scriptfactory/en/
=======================================================
_______________________________________________
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