2.5.1 Files of a Dylan program

Different Dylan environments store programs in different ways, but there is a file-based interchange format that all Dylan environments accept. In this interchange format, any program consists of a minimum of two files: a file containing the program itself, and a file describing the libraries and modules. The most trivial program consists of a single module in a single library, but it is still expressed in two files. Most Dylan implementations also accept a third file, which enumerates all the files that make up a program; this file is called a library-interchange definition (LID) file.

The details of how the files are named and stored depends on your Dylan implementation. Typically, however, you have a directory containing all the files of the program. As shown below, we name our program directory hello, and name the files hello.lid, library.dylan, and hello.dylan (the latter is the program file).

hello

  • hello Lid

  • library.dylan

  • hello.dylan

Comparison with C: The following analogies may help you to understand how the elements of Dylan programs correspond to elements of C programs:

  • The program files are similar to .c files in C.

  • The library file is similar to a C header file.

  • The LID file is similar to a makefile, which is used in certain C development environments.