Including clay modules

Blei edited this page Dec 28, 2011 · 5 revisions

As an example, we have a file /clay/libs/myownlib/test.clay that we want to include in our program.

In the source:

import myownlib.test.*;

When compiling:

The default search locations are $PREFIX/lib/lib-clay and the current directory

Clay will also search for includes in $CLAY_PATH and the -I argument if supplied

So to compile and run the program, we write:

CLAY_PATH="/clay/libs" clay -run main.clay

To add multiple directories to your $CLAY_PATH, separate them by : on Unix or by ; on Windows.