newLISP Fan Club

Forum => Anything else we might add? => Topic started by: alex on July 08, 2006, 12:21:03 AM

Title: (import) and (load)
Post by: alex on July 08, 2006, 12:21:03 AM
Why such difference?

We can "import" only one function, but we can "load" library.

Why we can't "import/load" full library?
Title:
Post by: newdep on July 08, 2006, 12:32:51 AM
Hi Alex,



Do you mean you want just to load the Library and isolate atomaticly the

defined functions from it?



Regards, Norman
Title:
Post by: alex on July 08, 2006, 02:53:42 AM
I am sorry for my bad English

I can't understand now why I can't (import) full library.

Why I must think about inner functions?
Title:
Post by: newdep on July 08, 2006, 05:51:30 AM
An import is a specific C call to open a library, because you dont know

in advance what the "defines"/"functions" are in the library you cant

do it directly with an import.



A "load" is specific for newlisp code..



Norman.
Title:
Post by: Lutz on July 08, 2006, 05:51:31 AM
Libraries typically contain a larger amount of functions for a specific area, much more than you would typically need in a specific application. Typically you import a a few functions but the library may contain hundreds.



Its like you city library, you just want to check out a few books but don't take the whole library home.



Lutz
Title:
Post by: alex on July 09, 2006, 11:41:52 AM
I understand all :)

And I have now theoretical(probably) question:

when I (import) function, I load full library to memory, or not?
Title:
Post by: Lutz on July 09, 2006, 05:23:13 PM
Only one instance of the library gets loaded on the OS, thats why they call it shared library. So even if you do several import statements you will load the library only once, or not at all, if another process on your machine has already loaded it.



Lutz