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

<!-- Copyright 2003, 2004 Steve Folta -->

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

<title> Introduction </title>

<header> What is Cleet, and Why? </header>

<p>
Cleet is an object-oriented programming language, with garbage
collection.  It is designed for writing application programs that are
compiled down to machine language (unlike Java or C#, which use an
interpreted intermediate code).  Eventually, it should also support an
interactive environment like Smalltalk or LISP.
</p>

<p>
Cleet generally uses the popular and concise C-style syntax.  Names may
contain hyphens, which are both less ugly and more typeable than
underscores.  The other thing that will stand out when reading Cleet
code is that declarations have the name of the variable -- the most
important piece of information to someone reading the code -- first,
followed by a colon and the type.
</p>

<p>
Here are some of the principles behind Cleet's design:  A computer
language ought to be easy to read, and should look good on the screen
or on the page.  It should be easy for the programmer to use --
including being easy to type, where possible.  Extremely common idioms
like iterating over a collection should be expressed in a "natural"
way, yet the language should be fairly easy for a computer to parse, so
that tools such as syntax-directed editors can be built.  And it ought
to be as conceptually simple as possible (unlike C++!).  These are the
goals that Cleet tries to balance.  It does this by combining a simple
object model with a few bits of carefully-chosen syntactic sugar.
</p>



<header> Hello World in Cleet </header>

<p>
Without further explanation:
</p>

<code>Class: HelloWorld
Superclass: Program

run()
{
  "Hello world!\n".write();
}</code>



<header> Another Example </header>

<code>Class: LineCountProgram
Superclass: Program

arguments: List of String;

create(arguments: List of String)
{
  this.arguments = arguments;
}

run()
{
  for (file-name: String in arguments.tail) {
    try {
      file: File(file-name);
      num-lines: Int = 0;
      for (line: String in file.contents.lines)
        num-lines += 1;
      (file-name + ": ").write();
      (num-lines.string + " lines.\n").write();
      }
    catch (error: Exception) {
      ("Error: " + error.message + "\n").write();
      }
    }
}</code>


<header> About This Document </header>

<p>
This is an introductory guide.  It generally assumes that you already
have some knowledge of object-oriented languages, but sometimes it goes
ahead and spells things out anyway.
</p>

</cleet-doc>

