2.5 A complete Dylan program
In this section, we show how to create a complete Dylan program. The Dylan program will print the following:
Hello, world
The Dylan expression that prints that output is
format-out("Hello, world\n");
A Dylan library defines a software component — a separately compilable unit that can be either a stand-alone program or a component of a larger program. Thus, when we talk about creating a Dylan program, we are really talking about creating a library.
A library contains modules. Each module contains definitions and expressions. The module is a namespace for the definitions and expressions. For example, if you define a module variable in one particular module, it is available to all the code in that module. If you choose to export that module variable, you can make it accessible to other modules that import it. In this chapter, we give the bare minimum of information about libraries and modules — just enough for you to get started quickly. For a complete description of libraries and modules, see Chapter 13, Libraries and Modules.
To create a complete Dylan program, we need
To define the library that is our program; we shall create a library named
helloTo define a module (or more than one) in the library, to hold the definitions and expressions in our program; we shall create a module named
helloin thehellolibraryTo write the program code, in the module; we shall put the
format-outexpression in thehellomodule of thehellolibrary




