Subject: What's the purpose of .lib files?

From: [email-masked] (Paolo Amoroso)
Date: Thu, 24 Sep 1998 16:32:11 GMT

What is the purpose of the .lib files generated by the compiler?

Paolo
-- 
Paolo Amoroso <[email-masked]>

---

From: Bruno Haible <[email-masked]>
Date: Thu, 24 Sep 1998 19:05:12 +0200 (MET DST)

> What is the purpose of the .lib files generated by the compiler?

The .lib files contain definitions that may be needed for compiling other
files.

Suppose you have a file A.lsp, defining functions, macros, constants etc.
And you have a file B.lsp, which contains a  (require 'A)  statement,
because it uses some things defined by A.lsp. Then compilations of B.lsp
will profit from a file A.lib, generated by a previous compilation of A.lsp.
The benefit is threefold:

  - You don't need to have A loaded in order to compile B. If memory
    is tight, and if A contains only few inline functions, macros or
    constants, this is a space and time saver. If A.lsp does a lot
    of initializations or side effects when being loaded, this is
    important as well.

  - You don't need to have A loaded in order to compile B. You don't
    even have to *think* about A when loading or compiling B.

  - Suppose A.lsp is changed rarely, and B.lsp is changed frequently.
    It would be a waste of time to compile both A and B every time.
    The .lib file ensures that A is compiled only when needed.

Bruno