Carapace

Carapace Script Reference

Carapace script is a simplified version of Lisp with some slight modifications to give support for objects.

This Reference covers the following topics:

syntax script syntax
functions functions within Carapace
classes & objects classes & objects within Carapace

Syntax

With one exception (see dot operator) every expression in Carapace script has the following syntax:

    ( fnName arg1 ... argN )
This is called prefix notation, since the function always precedes the arguments.

In ordinary arithmetic, to add 3 and 4 you would write:

    3 + 4
Using prefix notation, this becomes:
    (+ 3 4)
This is the pattern for every expression within Carapace script except for those which use the dot operator.

Functions

Script functions are declared using the function keyword. The declaration states what arguments the function takes as well as the type of the value returned.

Script functions are defined using the defun function (which stands for DEFin fUNction). The definition states what the function actually does.

Carapace contains many built-in functions.

Classes & Objects

A class defines an object -- ie. if defines the properties of the object and the operations which can be performed on the object. Classes are defined using the class keyword.

Carapace contains many built-in classes.


Contents Index Current topic: reference Related topics: objects, functions