mlib files contain the object code for one or more functions. Functions which happen to be stored
in libraries are called library functions, and Mata’s library functions are also stored in .mlib libraries.
You can create your own libraries, too.
Mata provides two ways to store object code:
1. In a .mo file, which contains the code for one function
2. In a .mlib library file, which may contain the code for up to 500 functions
.mo files are easier to use and work just as well as .mlib libraries; see [M-3] mata mosave. .mlib
libraries, however, are easier to distribute to others when you have many functions, because they are
combined into one file.
Outline of the procedure for dealing with libraries
Working with libraries is easy:
1. First, choose a name for your library. We will choose the name lpersonal.
2. Next, create an empty library by using the mata mlib create command.
3. After that, you can add new members to the library at any time, using mata mlib add.
.mlib libraries contain object code, not the original source code, so you need to keep track of the
source code yourself. Also, if you want to update the object code in a function stored in a library,
you must re-create the entire library; there is no way to replace or delete a member once it is added.
We begin by showing you the mechanical steps, and then we will tell you how we manage libraries
and source code.