<?xml version="1.0" ?>
<?xml-stylesheet type="text/css" href="stylesheet.css" ?>

<!-- Copyright 2003 Steve Folta -->

<cleet-doc xmlns:xlink="http://www.w3.org/1999/xlink">

<title> Namespaces </title>


<header> Using Namespaces </header>

<p>
Every class defined in a Cleet program is part of a namespace.  The
classes you define go into a namespace called <id>Main</id>.  The
standard classes are in a namespace called <id>Standard</id>.  There are
other namespaces for some system libraries, like <id>Xlib</id> and
<id>Xft</id>.
</p>

<p>
The code for a class can reference classes from multiple namespaces.  A
class automatically has access to classes in its own namespace, and to
classes in <id>Standard</id>.
</p>

<p>
A class can also be given access to all the classes in another namespace
by using the "<id>Uses:</id>" header:
</p>

<code>Class: MyWindow
Uses: Xlib

x-window: XWindow;   // ie. Xlib.XWindow</code>

<p>
Classes in other namespaces can also be referenced explicitly by giving
the name of the namespace, a dot, and the name of the class:
</p>

<code>Class: MyFont

primitive-font: Xft.Font;

create(display: Xlib.XDisplay)
{
  primitive-font =
    new Xft.Font("sans-serif-12", display);
}</code>



<header> Creating Your Own Namespaces </header>

<p>
...is not supported yet.  Probably it will be done through a
<path>namespaces</path> directory in the project directory, and/or a
<path>$CLEET_NAMESPACE_PATHS</path> environment variable.
</p>

</cleet-doc>
