(import) and (load)

Started by alex, July 08, 2006, 12:21:03 AM

Previous topic - Next topic

alex

Why such difference?

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

Why we can't "import/load" full library?

newdep

#1
Hi Alex,



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

defined functions from it?



Regards, Norman
-- (define? (Cornflakes))

alex

#2
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?

newdep

#3
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.
-- (define? (Cornflakes))

Lutz

#4
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

alex

#5
I understand all :)

And I have now theoretical(probably) question:

when I (import) function, I load full library to memory, or not?

Lutz

#6
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