Page 1 of 1

(import) and (load)

Posted: Sat Jul 08, 2006 7:21 am
by alex
Why such difference?
We can "import" only one function, but we can "load" library.
Why we can't "import/load" full library?

Posted: Sat Jul 08, 2006 7:32 am
by newdep
Hi Alex,

Do you mean you want just to load the Library and isolate atomaticly the
defined functions from it?

Regards, Norman

Posted: Sat Jul 08, 2006 9:53 am
by alex
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?

Posted: Sat Jul 08, 2006 12:51 pm
by newdep
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.

Posted: Sat Jul 08, 2006 12:51 pm
by Lutz
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

Posted: Sun Jul 09, 2006 6:41 pm
by alex
I understand all :)
And I have now theoretical(probably) question:
when I (import) function, I load full library to memory, or not?

Posted: Mon Jul 10, 2006 12:23 am
by Lutz
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