afnix-reference






vol‐2 ‐ afnix reference manual

Reserved keyword are, with symbols and literals, the basic
constituents of the writing system. With couple of
exception, reserved keywords are in fact special forms.
During the execution, a special

     assert
The assertspecial form check for equality between two
operands. Both objects must be of the same type. If the
equality test fails, the special form print a message and
abort the execution. By default, the assertion checking is
turned off. The interpreter option ‐f assertenables the
assertion checking. When the interpreter is compiled in
debug mode, the assertion checking is turned on by default.

     Syntax

     assert "form 1" "form 2"

     Example

     assert true (== 1 1) assert 3    (+  2 1)

     block
The blockspecial form defines a new nameset for sequential
execution of regular form or implicit form. When the block
form is evaluated, the block nameset is linked to its parent
nameset. When all forms have been executed, the block
nameset is destroyed and the result of the last evaluation
in the block is considered to be the result of the block
evaluation.

     Syntax

     block "regular form" block "block form"

     Example

     trans a 1 block {
       assert    a 1
       trans     a (+ 1 1)
       assert    a 2
       assert ..:a 1 } assert 1 a

     class
The classspecial form creates a new class object. Without
argument, an instance of that class is created without data
members.

     Syntax

     class










                             ‐2‐


     Example

     const Color (class) trans Color:preset (red green blue)
     {
       const this:red   red
       const this:green green
       const this:blue  blue } const red   (Color 255   0
     0) const green (Color   0 255   0) const blue  (Color
     0   0 255)

     const
The constspecial form binds a symbol with an object and
marks it as a constant symbol. When used with three or four
argument, a gamma expression is automatically created.
constcan also be used to bind class or instance members.

     Syntax

     const symbol "object" const symbol "argument" "body"
     const symbol "argument" "closed variables" "body"

     Example

     const number 123 const max (x y) (if (> x y) x y)

     delay
The delayspecial form delays the evaluation of the form
argument by creating a Promiseobject. The promise evaluate
to itself until a call to force the evaluation has been
made. When the promise has been forced, the evaluation
result is stored. Further call to force will produce the
same result. Without argument, the delayed evaluation is
nil. With one argument, a Promiseobject is created directly.
With several argument, a cons cell is created with the first
argument left unevaluated and the other evaluated. This
permit to delay a form while evaluatin the calling
arguments.

     Syntax

     delay "form"

     Example

     trans  y 3 const  l ((lambda (x) (+ x y)) 1) assert 4
     (force l) trans  y 0 assert 4 (force l) trans  y 1
     trans  d (delay (lambda (x) (+ x 1)) y) assert 2 (force
     d)

     do
The dospecial form is used to build loop with forward
condition. The loop construct accepts either 2 or 3
arguments. With 2 argument, the first argument is the loop
body and the second argument is the loop condition which









                             ‐3‐


must evaluates to a boolean object. With 3 arguments, the
first argument is the initial condition that is executed
only once.

     Syntax

     do "body" "condition" do "initial" "body" "condition"

     Example

     const number‐of‐digits (s) {
       const len (s:length)
       trans index 0
       trans count 0
       do {
         trans c (s:get index)
         if (c:digit‐p) (count:++)
       } (< (index:++) len)
       eval count }

     enum
The enumspecial form creates an enumeration from a list of
literal. The result object is an Enumobject that holds the
enumerated items. An item evaluation results with an
Itemobject that is bound to the enumeration object.

     Syntax

     enum "literal" ...

     Example

     const e (enum E1 E2 E3)

     errorln
The errorlnspecial form prints on the interpreter error
stream a set of arguments. Each arguments have to be a
literal which are converted to a string. When all arguments
have been printed a new line character is printed. The
errorspecial form behaves like errorlnexcepts that a new
line character is not printed at the end of the arguments.

     Syntax

     errorln errorln "nil" errorln "literal list"

     Example

     errorln errorln "hello millennium" ’ ’ 2000

     eval
The evalspecial form simply evaluates the object argument.
The form is useful when returning an argument from a lambda
or gamma expression using an implicit form.









                             ‐4‐


     Syntax

     eval "object"

     Example

     const ret (x) (eval x) eval (protect (+ 1 2))

     for
The forspecial form provides a facility to iterate on
iterable objects. The Cons, Listand Vectorobjects are
typical iterable objects. For each iterable objects, a
symbol is set after each iteration. Each object symbol value
can be used for further computation. The iteration stops
when one of the objects iterator is at the end position.

     Syntax

     for "symbol list" "iterable object list" "body"

     Example

     # compute the scalar product of two vectors const
     scalar‐product (u v) {
       trans result 0
       for (x y) (u v) (result:+= (* x y))
       eval result }

     force
The forcespecial form forces the evaluation of its argument.
If the argument evaluates to a promise object, the promise
evaluation is forced. If the argument is not a promise,
forcekeyword behaves like eval. When a promise has been
forced, further call to force will not change the evaluation
result.

     Syntax

     force "object"

     Example

     trans  y 3 const  l ((lambda (x) (+ x y)) 1) assert 4
     (force l) trans  y 0 assert 4 (force l)

     if
The ifspecial form executes a form based on the evaluation
of a boolean expression. In its first representation,
ifexecutes a form if the condition is evaluated to true. An
alternate form can be specified and is executed if the
boolean expression evaluates to false. It is an error to use
a conditional form which does not evaluate to a boolean
object.










                             ‐5‐


     Syntax

     if "condition" "true form" if "condition" "true form"
     "else form"

     Example

     const max (x y) (if (> x y) x y)

     lambda
The lambdaspecial form creates a new closure object with
eventually a set of arguments and a set of closed variables.
In its first form, the closure is declared with a set of
arguments or nil to indicate no argument. In its second
form, the closure is declared with a set of arguments and a
set of closed variables. The closed variables are evaluated
at the construction of the closure and become part of the
closure object. When the closure is called, a new nameset is
created and linked with the parent nameset. The set of
calling arguments are bounded in that nameset with the
formal argument list to become the actual arguments. The set
of closed variables is linked at runtime to the closure
nameset. A lambda or gamma expression can have its argument
declared as constargument.

     Syntax

     lambda "nil" "body" lambda "argument list" "body"
     lambda "argument list" "closed variables list" "body"

     Example

     const no‐args (lambda nil (+ 1 1)) const add
     (lambda ((const x) (const y)) (+ x y)) const closed
     (lambda (x) (y) (+ x y))

     launch
The launchspecial form creates a new thread by executing the
form argument in a normal thread. The created thread is
added in the normal thread list by creating a clone of the
interpreter and starting immediately the execution of the
form with the cloned interpreter. The command returns the
thread object in the calling thread. When the thread
terminates, the thread object holds the result of the last
executed form. The main thread is suspended until all normal
threads have completed their execution.

     Syntax

     launch "form" launch "thread" "form"

     Example

     launch (println "hello world")









                             ‐6‐


     loop
The loopspecial form executes a loop based on an initial
condition, an exit condition and a step form. The initial
condition is only executed one time. The exit condition is
tested at each loop iteration. The loopspecial form creates
its own nameset since the initial condition generally binds
symbol locally for the loop.

     Syntax

     loop "init form" "exit form" "step" "form"

     Example

     loop (trans i 0) (< i 10) (i:++) (println i)

     nameset
The namesetspecial form creates a new nameset. With no
argument, a new nameset is created and no parent is binded
to this nameset. With one argument, the argument must
evaluate to a nameset and that nameset is used as the parent
one. If a nameset has to be created with the global nameset
as the parent, the symbol ...can be used to reference the
top level nameset. The symbol .references the current
nameset. The symbol ..references the parent nameset of the
current nameset.

     Syntax

     nameset nameset "parent nameset"

     Example

     const local‐nameset‐not‐bound (nameset) const local‐
     nameset‐bounded   (nameset ...)  const ...:global‐
     nameset      (nameset)

     println
The printlnspecial form prints on the interpreter output
stream a set of arguments. Each arguments have to be a
literal which is converted to a string. When all arguments
have been printed a new line character is printed. The
printspecial form behaves like printlnexcepts that a new
line character is not printed at the end of the arguments.

     Syntax

     println println "nil" println "literal list"

     Example

     println println "hello millennium" ’ ’ 2000











                             ‐7‐


     protect
The protectspecial form take a single argument and returns
it without evaluation. Protect is mainly use to get a symbol
or form object.

     Syntax

     protect "object"

     Example

     const cons (protect (+ 1 2))

     return
The returnspecial form causes the current expression to stop
its evaluation and returns the argument or nil. The
returnkeyword is primarily used in lambda or gamma
expressions. If used in a top level block, the block
execution is stopped and the control is transferred to the
top level.

     Syntax

     return "object"

     Example

     return (+ 1 2)

     sync
The syncspecial form is a form synchronizer. Within a multi‐
threaded environment, the engine guarantees that only one
thread will execute the form. The other threads are
suspended until the form has been completed.

     Syntax

     sync "form"

     Example

     const print‐message (code mesg) (
       sync {
         errorln "error  : " code
         errorln "message: " mesg
       } )

     switch
The switchspecial form is a form selector. The first
argument is the object to switch. The second argument is a
list of forms with an object matcher and an execution form.
The elsespecial form can be used as default matcher.











                             ‐8‐


     Syntax

     switch "selector" "list of conditions"

     Example

     const get‐primary‐color (color value) (
       switch color (
         ("red"   (return (value:substr 0 2))
           ("green" (return (value:substr 2 4))
             ("blue"  (return (value:substr 4 6))
             )
           )

     throw
The throwspecial form throws an exception. Without argument,
an exception of type user‐exception is thrown. With one
argument, the exception id is set. With two arguments, the
exception id and exception reason are set. With three
arguments, the exception id, exception reason and exception
object are set. An exception object represented by the
symbol whatcan also be thrown. This is the method used to
re‐throw an exception.

     Syntax

     throw throw what throw "id" throw "id" "reason" throw
     "id" "reason" "object"

     Example

     throw throw "type‐error" throw "type‐error" "invalid
     argument"

     trans
The transspecial form creates or sets a symbol with an
object. transsearches in the current nameset only. If a
symbol is found, it is set with the object. If the symbol is
not found, it is created in the current nameset. The
transkeyword can also be used with qualified names. With 3
or 4 arguments, transcreates automatically a lambda
expression.

     Syntax

     trans symbol "object" trans symbol "argument" "body"
     trans symbol "argument" "closed variables" "body"

     Example

     trans a 1 trans fact (n) (if (< n 1) 1 (* n (fact (‐ n
     1))))











                             ‐9‐


     try
The tryspecial form catch an exception in the current
execution nameset. The first argument is a form to execute.
The optional second argument is the exception handler to be
called in case of exception. If there is no exception
handler, all exceptions are caught. The result of execution
is either the result of the form execution, or the exception
object in case of exception, or nil if the exception is a
native one. If there is an exception handler, the handler is
executed with a new nameset and the special symbol whatis
bound to the exception. If the exception is nil, the symbol
whatis undefined.

     Syntax

     try "form" try "form" " exception handler"

     Example

     try (+ 1 2) try (throw) try (throw "hello") try (throw
     "hello" "world") try (throw "hello" "world" "folks")

     unref
The unrefspecial form unreference a symbol.

     Syntax

     unref symbol

     Example

     const number 123 unref number

     while
The whilespecial form is used to build loop with backward
condition. The loop construct accepts either 2 or 3
arguments. With 2 argument, the first argument is the loop
condition and the second argument is the loop body that must
evaluate to a boolean. With 3 arguments, the first argument
is the initial condition that is executed only once.

     Syntax

     while "condition" "body" while "initial" "condition"
     "body"

     Example

     const gcd (u v) {
       while (!= v 0) {
         trans r (u:mod v)
         u:= v
         v:= r
       }









                            ‐10‐


       eval u }

This chapter is a reference of the reserved objects with
their respective builtin methods. The reserved objects are
those objects defined in the global interpreter nameset and
bind as reserved names. All literal have a string
representation. The to‐stringmethod is always available for
these reserved objects. A literal object has a default
constructor. Generally, it can also be constructed by a same
type object or by a string object.

     Literal
The Literalobject is a base object for all literal object.
The sole purpose of a literal object is to provide to
methods named to‐stringand to‐literalthat return a string
representation of the literal object.

     Predicate

     literal‐p

     Inheritance

     Serial

     Methods

     Stringto‐string‐>
     The to‐stringmethod returns a string representation of
     the literal. The string is expected to represent at
     best the literal.

     Stringto‐literal‐>
     The to‐literalmethod returns a string representation of
     the literal. The string differs from the to‐
     stringmethod in the sense that the string is a literal
     representation. For example the literal representation
     of a string is the quoted string.

     Nameable
The Nameableobject is a base object that support name
definition. The sole purpose of a literal object is to
provide to method named get‐namethat returns the object
name.

     Predicate

     nameable‐p

     Inheritance

     Object











                            ‐11‐


     Methods

     Stringget‐name‐>
     The get‐namemethod returns the associated object name.
     The object name defined here is a name that the class
     wishes to associate with the object. For example, the
     InputFileis a nameable class and the name is the file
     name.

     Collectable
The Collectableobject is a base object designed to provide
the methods for collectable object. Collectable objects are
special objects that can be controlled by a special memory
manager, called a memory collector or garbage collector.
Unlike a simple object associated with a reference count,
the collectable object is also controled by special methods.
In particular, the ’release’ method can be invoked to
release all internal links susceptible to create loops and
thus preventing the object to be release by the standard
reference count mechanism. Releasing a link do not
necessarily result in the object destruction.

     Predicate

     collectable‐p

     Inheritance

     Object

     Methods

     nonerelease‐>
     The releasemethod releases all links associated with
     the object. This method is naturally used to break
     circular dependencies which prohibits the normal object
     destruction by the mean of reference counting.

     Item
The Itemreserved object is an enumeration item. The item is
bound to an enumeration object. An item object is created
during the evaluation of an enumeration object. An
enumeration item cannot be constructed directly.

     Predicate

     item‐p

     Inheritance

     Literal

     Operators










                            ‐12‐


     Boolean==‐>
     The ==operator returns true if the calling object is
     equal to the boolean argument.

     Boolean!=‐>
     The ==operator returns true if the calling object is
     not equal to the boolean argument.

     Methods

     Enumget‐enum‐>
     The get‐enummethod returns the enumeration object bound
     to the item. The item must be a dynamic item or an
     exception is thrown.

     Boolean
The Booleanreserved object implements the behavior of a
native boolean type. Two builtin symbols, namely true and
false are used to represent the value of a boolean instance.
The Booleantype is primarily used for test expression.

     Predicate

     boolean‐p

     Inheritance

     Literal

     Constructors

     Boolean(none)
     The Booleanconstructor create a boolean object those
     default value is false.

     Boolean(Boolean)
     The Booleanconstructor create a boolean object with the
     boolean object argument.

     Boolean(String)
     The Booleanconstructor create a boolean object with the
     string object argument. The string "true"denotes the
     true value while the string "false"denotes the false
     value.

     Operators

     Boolean==‐>
     The ==operator returns true if the calling object is
     equal to the boolean argument.

     Boolean!=‐>
     The ==operator returns true if the calling object is
     not equal to the boolean argument.









                            ‐13‐


     Number
The Numberreserved objectis a base class for all number
objects. The number base object is used by the Integer,
Realand Relatifobjects. The class provides essentially the
methods needed to format a number.

     Predicate

     number‐p

     Inheritance

     Literal

     Methods

     Stringformat‐>
     The formatmethod format the calling number instance
     with a certain number of digits after the decimal
     point. In the first form without argument, the default
     formating representation is performed with a null
     precision. In the second format, a number is
     represented with a certain precision given by the
     calling argument.

     Stringto‐hexa‐>
     The to‐hexamethod returns a signed hexadecimal
     representation of a number. This method works well with
     Integerand Relatifobjects.

     Stringto‐hexa‐string‐>
     The to‐hexa‐stringmethod returns a hexadecimal
     representation of a number without a prefix. The number
     is always considered positive. This method works well
     with Integerand Relatifobjects.

     Integer
The Integerreserved object implements the behavior of a
native 64 bits signed integer type. Standard decimal
notation is used to construct integer object from a literal.
The integer object can also be constructed from a string.
Standard operators are provided for this class. The
Integerobject is a literal object derived from the
Numberobject.

     Predicate

     integer‐p

     Inheritance

     Number











                            ‐14‐


     Constructors

     Integer(none)
     The Integerconstructor create an integer object those
     default value is 0.

     Integer(Real)
     The Integerconstructor create an integer object with
     the real object argument those value is truncated to an
     integer value.

     Integer(Integer)
     The Integerconstructor create an integer object with
     the integer object argument.

     Integer(Character)
     The Integerconstructor create an integer object with
     the character object argument. The character encoding
     value is used as the integer value.

     Operators

     Boolean==‐>
     The ==operator returns true if the calling object is
     equal to the integer or real argument.

     Boolean!=‐>
     The !=operator returns true if the calling object is
     not equal to the integer or real argument.

     Integer+‐>
     The +operator returns the sum of the calling integer
     with an integer or a real object.

     Integer‐>
     The ‐operator returns the subtraction of the calling
     integer with an integer or a real object.

     Integer*‐>
     The *operator returns the multiplication of the calling
     integer with an integer or a real object.

     Integer/‐>
     The /operator returns the division of the calling
     integer with an integer or a real object.

     Boolean<‐>
     The <operator returns true if the calling integer is
     less than the integer or real object.

     Boolean<=‐>
     The <=operator returns true if the calling integer is
     less equal than the integer or real object.










                            ‐15‐


     Boolean>‐>
     The >operator returns true if the calling integer is
     greater than the integer or real object.

     Boolean>=‐>
     The >=operator returns true if the calling integer is
     greater equal than the integer or real object.

     Integer++‐>
     The ++operator increments the calling integer by 1.

     Integer‐‐‐>
     The ‐‐operator decrements the calling integer by 1.

     Integer+=‐>
     The +=operator add and assign the calling integer with
     an integer or real argument object.

     Integer‐=‐>
     The ‐=operator subtracts and assign the calling integer
     with an integer or real argument object.

     Integer*=‐>
     The *=operator multiply and assign the calling integer
     with an integer or real argument object.

     Integer/=‐>
     The /=operator divide and assign the calling integer
     with an integer or real argument object.

     Methods

     Integeror‐>
     The ormethod returns the binary or between the integer
     and the integer argument.

     Integerabs‐>
     The absmethod returns the absolute value of the calling
     integer instance.

     Integernot‐>
     The notmethod returns the binary negation of the
     calling integer instance.

     Integershl‐>
     The shlmethod returns a new integer corresponding to
     the calling integer instance shifted left by the
     integer argument.

     Integershr‐>
     The shrmethod returns a new integer corresponding to
     the calling integer instance shifted right by the
     integer argument.










                            ‐16‐


     Integerand‐>
     The andmethod returns a new integer corresponding to
     the binary and between the calling integer instance and
     the integer argument.

     Integerxor‐>
     The xormethod returns a new integer corresponding to
     the binary xor between the calling integer instance and
     the integer argument.

     Integermod‐>
     The modmethod returns the modulo between the integer
     instance and the integer argument. A type‐
     errorexception is raised if the argument is not an
     argument.

     Booleanodd‐p‐>
     The odd‐pmethod returns true if the integer instance is
     odd, false otherwise.

     Booleaneven‐p‐>
     The even‐pmethod returns true if the integer instance
     is even, false otherwise.

     Booleanzero‐p‐>
     The zero‐pmethod returns true if the integer instance
     is null, false otherwise.

     Relatif
The Relatifreserved object implements the behavior of an
unlimited signed integer type. Standard decimal notation
followed by the ’r’ or ’R’ character is used to construct
relatif object from a literal. The relatif object can also
be constructed from a string. This class is similar to the
Integerclass. The Relatifis a literal object derived from
the Numberobject.

     Predicate

     relatif‐p

     Inheritance

     Number

     Constructors

     Relatif(none)
     The Relatifconstructor create a relatif object those
     default value is 0.

     Relatif(Real)
     The Relatifconstructor create an relatif object with
     the real object argument those value is truncated to an









                            ‐17‐


     integer value.

     Relatif(Relatif)
     The Relatifconstructor create an relatif object with
     the relatif object argument.

     Relatif(Integer)
     The Relatifconstructor create an relatif object with
     the integer object argument.

     Relatif(Character)
     The Relatifconstructor create an relatif object with
     the character object argument. The character encoding
     value is used as the relatif value.

     Operators

     Boolean==‐>
     The ==operator returns true if the calling object is
     equal to the relatif or integer argument.

     Boolean!=‐>
     The ==operator returns true if the calling object is
     not equal to the relatif or integer argument.

     Relatif+‐>
     The +operator returns the sum of the calling relatif
     with an relatif or a integer object.

     Relatif‐>
     The ‐operator returns the subtraction of the calling
     relatif with an relatif or a integer object.

     Relatif*‐>
     The *operator returns the multiplication of the calling
     relatif with an relatif or a integer object.

     Relatif/‐>
     The /operator returns the division of the calling
     relatif with an relatif or a integer object.

     Boolean<‐>
     The <operator returns true if the calling relatif is
     less than the relatif or integer object.

     Boolean<=‐>
     The <=operator returns true if the calling relatif is
     less equal than the relatif or integer object.

     Boolean>‐>
     The >operator returns true if the calling relatif is
     greater than the relatif or integer object.

     Boolean>=‐>









                            ‐18‐


     The >=operator returns true if the calling relatif is
     greater equal than the relatif or integer object.

     Relatif++‐>
     The ++operator increments the calling relatif by 1.

     Relatif‐‐‐>
     The ‐‐operator decrements the calling relatif by 1.

     Relatif+=‐>
     The +=operator add and assign the calling relatif with
     an relatif or integer argument object.

     Relatif‐=‐>
     The ‐=operator subtracts and assign the calling relatif
     with an relatif or integer argument object.

     Relatif*=‐>
     The *=operator multiply and assign the calling relatif
     with an relatif or integer argument object.

     Relatif/=‐>
     The /=operator divide and assign the calling relatif
     with an relatif or integer argument object.

     Methods

     Relatifor‐>
     The ormethod returns the binary or between the relatif
     and the relatif argument.

     Relatifabs‐>
     The absmethod returns the absolute value of the calling
     relatif instance.

     Relatifnot‐>
     The notmethod returns the binary negation of the
     calling relatif instance.

     Relatifshl‐>
     The shlmethod returns a new relatif corresponding to
     the calling relatif instance shifted left by the
     integer argument.

     Relatifshr‐>
     The shrmethod returns a new relatif corresponding to
     the calling relatif instance shifted right by the
     integer argument.

     Relatifpow‐>
     The powmethod returns a new relatif corresponding to
     the power of the calling relatif instance with the
     integer or relatif argument. With one argument, the
     power is computed directly. With two arguments, a fast









                            ‐19‐


     modular exponentiation is performed with the second
     argument as the modulus.

     Relatifmmi‐>
     The mmimethod returns the multiplicative modular
     inverse of the calling relatif. The argument is the
     modulus to use for the inverse calculation.

     Relatifand‐>
     The andmethod returns a new relatif corresponding to
     the binary and between the calling relatif instance and
     the relatif argument.

     Relatifxor‐>
     The xormethod returns a new relatif corresponding to
     the binary xor between the calling relatif instance and
     the relatif argument.

     Relatifmod‐>
     The modmethod returns the modulo between the relatif
     instance and the relatif or integer argument. A type‐
     errorexception is raised if the argument is invalid.

     Booleanodd‐p‐>
     The odd‐pmethod returns true if the relatif instance is
     odd, false otherwise.

     Booleaneven‐p‐>
     The even‐pmethod returns true if the relatif instance
     is even, false otherwise.

     Booleanzero‐p‐>
     The zero‐pmethod returns true if the relatif instance
     is null, false otherwise.

     Integerget‐msb‐>
     The get‐msbmethod returns the most significnd bit
     position for the calling relatif. If the number is
     null, 0 is returned. The msb position is thus counted
     from 1.

     Real
The Realreserved object implements the behavior of a double
floating point number type. Standard decimal dot notation or
scientific notation is used to construct real object from a
literal. The real object can also be constructed from an
integer, a character or a string. The Realobject is a
literal object derived from the Numberobject.

     Predicate

     real‐p











                            ‐20‐


     Inheritance

     Number

     Constructors

     Real(none)
     The Realconstructor create an real object those default
     value is 0.0.

     Real(Real)
     The Realconstructor create an real object with the real
     object argument.

     Real(Integer)
     The Realconstructor create an real object with the
     integer object argument.

     Real(Character)
     The Realconstructor create an real object with the
     character object argument. The character encoding value
     is used as the integer value.

     Operators

     Boolean==‐>
     The ==operator returns true if the calling object is
     equal to the integer or real argument.

     Boolean!=‐>
     The ==operator returns true if the calling object is
     not equal to the integer or real argument.

     Real+‐>
     The +operator returns the sum of the calling real with
     an integer or a real object.

     Real‐>
     The ‐operator returns the subtraction of the calling
     real with an integer or a real object.

     Real*‐>
     The *operator returns the multiplication of the calling
     real with an integer or a real object.

     Real/‐>
     The /operator returns the division of the calling real
     with an integer or a real object.

     Boolean<‐>
     The <operator returns true if the calling real is less
     than the integer or real object.

     Boolean<=‐>









                            ‐21‐


     The <=operator returns true if the calling real is less
     equal than the integer or real object.

     Boolean>‐>
     The >operator returns true if the calling real is
     greater than the integer or real object.

     Boolean>=‐>
     The >=operator returns true if the calling real is
     greater equal than the integer or real object.

     Real++‐>
     The ++operator increments the calling real by 1.

     Real‐‐‐>
     The ‐‐operator decrements the calling real by 1.

     Real+=‐>
     The +=operator add and assign the calling real with an
     integer or real argument object.

     Real‐=‐>
     The ‐=operator subtracts and assign the calling real
     with an integer or real argument object.

     Real*=‐>
     The *=operator multiply and assign the calling real
     with an integer or real argument object.

     Real/=‐>
     The +=operator divide and assign the calling real with
     an integer or real argument object.

     Methods

     Booleannan‐p‐>
     The nan‐pmethod returns true if the calling real number
     instance is not‐a‐number (nan).

     Realceiling‐>
     The ceilingmethod returns the ceiling of the calling
     real number instance.

     Realfloor‐>
     The floormethod returns the floor of the calling real
     number instance.

     Realabs‐>
     The absmethod returns the absolute value of the calling
     real number instance.

     Realpow‐>
     The powmethod returns the power of the calling real
     with the argument. The exponent argument can be either









                            ‐22‐


     an integer or a real number.

     Realsqrt‐>
     The sqrtmethod returns the square root of the calling
     real number instance.

     Realln‐>
     The lnmethod returns the natural logarithm of the
     calling real number instance.

     Realexp‐>
     The expmethod returns the exponential of the calling
     real number instance.

     Realsin‐>
     The sinmethod returns the sine of the calling floating
     point instance. The angle is expressed in radian.

     Realcos‐>
     The cosmethod returns the cosine of the calling
     floating point instance. The angle is expressed in
     radian.

     Realtan‐>
     The tanmethod returns the tangent of the calling
     floating point instance. The angle is expressed in
     radian.

     Realasin‐>
     The asinmethod returns the arc sine of the calling
     floating point instance. The result is in radian.

     Realacos‐>
     The acosmethod returns the arc cosine of the calling
     floating point instance. The result is in radian.

     Realatan‐>
     The atanmethod returns the arc tangent of the calling
     floating point instance. The result is in radian.

     Realsinh‐>
     The sinhmethod returns the hyperbolic sine of the
     calling real number instance.

     Realcosh‐>
     The coshmethod returns the hyperbolic cosine of the
     calling real number instance.

     Realtanh‐>
     The atanmethod returns the hyperbolic tangent of the
     calling real number instance.

     Realasinh‐>
     The asinhmethod returns the hyperbolic arc sine of the









                            ‐23‐


     calling real number instance.

     Realacosh‐>
     The acoshmethod returns the hyperbolic arc cosine of
     the calling real number instance.

     Realatanh‐>
     The atanhmethod returns the hyperbolic arc tangent of
     the calling real number instance.

     Booleanzero‐p‐>
     The zero‐pmethod returns true if the calling real
     instance is null, false otherwise.

     Character
The Characterreserved object implements the behavior of an
Unicode character type. A character can be constructed from
a literal quoted notation, with a string or with the
U+hexadecimal notation. The character class is designed to
handle the full range of the Unicode character space by
using an internal 32 bit quad representation with 31 bit
valid. The Characterclass conform also with the ISO 10646
character representation.

     Predicate

     character‐p

     Inheritance

     Literal

     Constructors

     Character(none)
     The Characterconstructor create a character object
     those default value is the null character.

     Character(String)
     The Characterconstructor create a character object with
     the string object argument.

     Character(Integer)
     The Characterconstructor create a character object with
     the integer object argument.

     Character(Character)
     The Characterconstructor create a character object with
     the character object argument.

     Operators

     Boolean==‐>
     The ==operator returns true if the calling object is









                            ‐24‐


     equal to the character argument.

     Boolean!=‐>
     The !=operator returns true if the calling object is
     not equal to the character argument.

     Boolean<‐>
     The <operator returns true if the calling character is
     less than the character object.

     Boolean<=‐>
     The <=operator returns true if the calling character is
     less equal than the character object.

     Boolean>‐>
     The >operator returns true if the calling character is
     greater than the character object.

     Boolean>=‐>
     The >=operator returns true if the calling character is
     greater equal than the character object.

     Character++‐>
     The ++operator increments the calling character by the
     next one in lexicographic order.

     Character‐‐‐>
     The ‐‐operator decrements the calling character by the
     previous one in lexicographic order.

     Character+=‐>
     The +=operator add the integer argument to the calling
     character.

     Character‐=‐>
     The ‐=operator subtracts the integer argument to the
     calling character.

     Methods

     Booleanletter‐p‐>
     The letter‐ppredicate returns true if the character is
     a letter character, falseotherwise.

     Booleandigit‐p‐>
     The digit‐ppredicate returns true if the character is a
     digit character, false otherwise.

     Booleanalpha‐p‐>
     The alpha‐ppredicate returns true if the character is
     an alphanumeric character, falseotherwise.

     Booleanblank‐p‐>
     The blank‐ppredicate returns true if the character is a









                            ‐25‐


     blank or tab character, false otherwise.

     Booleaneol‐p‐>
     The eol‐ppredicate returns true if the character is an
     end‐of‐linecharacter, false otherwise.

     Booleaneos‐p‐>
     The eos‐ppredicate returns true if the character is an
     end‐of‐streamcharacter, false otherwise.

     Booleannil‐p‐>
     The nil‐ppredicate returns true if the character is the
     nil character, false otherwise.

     Integerto‐integer‐>
     The to‐integermethod returns an integer representation
     of the characters.

     Byte
The Bytereserved object implements the behavior of an 8 bit
character type. A byte can be constructed from a integer or
from another byte. The Byteclass is similar to the
Characterclass but is not a literal object because it does
not have a literal representation. Most of the time, a byte
object is created by another object like a stream, when
using the readmethod for example.

     Predicate

     byte‐p

     Inheritance

     Serial

     Constructors

     Byte(none)
     The Byteconstructor create a byte object those default
     value is the null byte.

     Byte(Integer)
     The Byteconstructor create a byte object with the
     integer object argument. The integer value must be in
     the range of 0x00 to 0xFF.

     Byte(Byte)
     The Byteconstructor create a byte object with the byte
     object argument.

     Operators

     Boolean==‐>
     The ==operator returns true if the calling object is









                            ‐26‐


     equal to the byte argument.

     Boolean!=‐>
     The !=operator returns true if the calling object is
     not equal to the byte argument.

     Boolean<‐>
     The <operator returns true if the calling byte is less
     than the byte object.

     Boolean<=‐>
     The <=operator returns true if the calling byte is less
     equal than the byte object.

     Boolean>‐>
     The >operator returns true if the calling byte is
     greater than the byte object.

     Boolean>=‐>
     The >=operator returns true if the calling byte is
     greater equal than the byte object.

     Byte++‐>
     The ++operator increments the calling byte by one.

     Byte‐‐‐>
     The ‐‐operator decrements the calling byte by one.

     Byte+=‐>
     The +=operator adds the integer argument to the calling
     byte.

     Byte‐=‐>
     The ‐=operator subtracts the integer argument to the
     calling byte.

     Methods

     Booleaneos‐p‐>
     The eos‐ppredicate returns true if the character is an
     end‐of‐streamcharacter, false otherwise.

     Booleannil‐p‐>
     The nil‐ppredicate returns true if the byte is the nil
     byte, false otherwise.

     Integerto‐integer‐>
     The to‐integermethod returns an integer representation
     of the byte.

     Characterto‐char‐>
     The to‐charmethod returns a character representing the
     byte.










                            ‐27‐


     String
The Stringreserved object implements the behavior of an
internal character array. The double quote notation is the
literal notation for a string. A string can also be
constructed from the standard objects. Strings can be
compared, transformed or extracted with the help of the
methods listed below. Internally, the string is represented
as an array of Unicode characters.

     Predicate

     string‐p

     Inheritance

     Literal

     Constructors

     String(none)
     The Stringconstructor create a string object those
     default value is the null string.

     String(Literal)
     The Stringconstructor create a string object with the
     literal object argument.

     Operators

     Boolean==‐>
     The ==operator returns true if the calling object is
     equal to the string argument.

     Boolean!=‐>
     The !=operator returns true if the calling object is
     not equal to the string argument.

     Boolean<‐>
     The <operator returns true if the calling string is
     less than the string argument.

     Boolean<=‐>
     The <=operator returns true if the calling string is
     less equal than the string argument.

     Boolean>‐>
     The >operator returns true if the calling string is
     greater than the string argument.

     Boolean>=‐>
     The >=operator returns true if the calling string is
     greater equal than the string argument.

     String+‐>









                            ‐28‐


     The +operator returns the sum of the calling string
     with an string object.

     String+=‐>
     The +=operator add and assign the calling string with
     the string argument.

     Methods

     Integerlength‐>
     The lengthmethod returns the length of the string.

     Characterfirst‐>
     The firstmethod returns the first character in the
     string.

     Characterlast‐>
     The lastmethod returns the last character in the
     string.

     Stringstrip‐left‐>
     The strip‐leftmethod removes the leading blanks and
     tabs and returns a new string. With a string argument,
     each character in the string is taken as a character
     separator that should be stripped.

     Stringstrip‐right‐>
     The strip‐rightmethod removes the trailing blanks and
     tabs and returns a new string.With a string argument,
     each character in the string is taken as a character
     separator that should be stripped.

     Stringstrip‐>
     The stripmethod removes the leading, trailing blanks
     and tabs and returns a new string. With a string
     argument, each character in the string is taken as a
     character separator that should be stripped.

     Vectorsplit‐>
     The splitmethod split the string into one or more
     string according to break sequence. If no argument is
     passed to the call, the break sequence is assumed to be
     a blank, tab and eol characters.

     Vectorextract‐>
     The extractmethod extracts one or more string which are
     enclosed by a control character passed as an argument.
     The method returns a vector of strings.

     Stringto‐upper‐>
     The to‐upperconverts all string characters to upper
     case and returns a new string.

     Stringto‐lower‐>









                            ‐29‐


     The to‐lowermethod converts all string characters to
     lower case and returns a new string.

     Characterget‐>
     The getmethod returns a the string character at the
     position given by the argument. If the index is
     invalid, an exception is raised.

     Stringsub‐left‐>
     The sub‐leftmethod returns the left sub string of the
     calling string up‐to the argument index. If the index
     is out of range, the string is returned.

     Stringsub‐right‐>
     The sub‐rightmethod returns the right sub string of the
     calling string starting at the argument index. If the
     index is out of range, the string is returned.

     Stringfill‐left‐>
     The fill‐leftmethod returns a string filled on the left
     with the character argument. The second argument is the
     desired length of the resulting string. If the calling
     is too long, the string is returned.

     Stringfill‐right‐>
     The fill‐leftmethod returns a string filled on the
     right with the character argument. The second argument
     is the desired length of the resulting string. If the
     calling is too long, the string is returned.

     Stringsubstr‐>
     The substrmethod returns a string starting at the first
     argument index and ending at the second argument index.
     If the indexes are out of range, an exception is
     raised.

     Booleanstrcic‐>
     The strcicmethod compare the calling string with the
     argument string in a case insensitive way.

     Regex
The Regexobject is a special object which is automatically
instantiated by the interpreter when using the delimiter
character [and ]. The regex syntax involves the use of
standard characters, meta characters and control characters.
Additionally, a string can be use to specify a series of
characters. In its first form, the [and ]characters are used
as syntax delimiters. The lexical analyzer automatically
recognizes this token as a regex and built the equivalent
Regexobject. The second form is the explicit construction of
the Regexobject. Note also that the [and ]characters are
also used as regex block delimiters. Any character, except
the one used as operators can be used in a regex. The
$character is used as a meta‐character ‐‐ or control









                            ‐30‐


character ‐‐ to represent a particular set of characters.
For example, [hello world]is a regex which match only the
"hello world"string. The [$d+]regex matches one or more
digits. The following control characters are builtin in the
regex engine.

Character   Description
$a          matches any letter or digit
$b          matches any blank characters
$c          matches any combining characters
$d          matches any digit
$e          matches eol, cr and eos
$l          matches any lower case letter
$n          matches eol or cr
$s          matches any letter
$u          matches any upper case letter
$v          matches any valid constituent
$w          matches any word constituent
$x          matches any hexadecimal characters


The uppercase version is the complement of the corresponding
lowercase character set. A character which follows a
$character and that is not a meta character is treated as a
normal character. For example $[is the [character. A quoted
string can be used to define character matching which could
otherwise be interpreted as control characters or operator.
A quoted string also interprets standard escaped sequences
but not meta characters.

Character   Description
$A          any character except letter or digit
$B          any character except blank characters
$C          any character except combining characters
$D          any character except digit
$E          any character except eol, cr and eos
$L          any character except lower case letter
$N          any character except eol or cr
$S          any character except letter
$U          any character except upper case letter
$V          any character except constituent
$W          any character except word constituent
$X          any character except hex characters


A character set is defined with the <and >characters. Any
enclosed character defines a character set. Note that meta
characters are also interpreted inside a character set. For
example, <$d+‐>represents any digit or a plus or minus. If
the first character is the ^character in the character set,
the character set is complemented with regards to its
definition. The following unary operators can be used with
single character, control characters and sub‐expressions.










                            ‐31‐


Operator   Description
*          match 0 or more times
+          match 1 or more times
?          match 0 or 1 time
|          alternation


Alternation is an operator which work with a secondary
expression. Care should be taken when writing the right sub‐
expression. For example the following regex [$d|hello]is
equivalent to [[$d|h]ello]. In other word, the minimal first
sub‐expression is used when compiling the regex.

     Predicate

     regex‐p

     Inheritance

     Literal

     Constructors

     Regex(none)
     The Regexconstructor create a regex object those
     default value is the null regex.

     Regex(String)
     The Regexconstructor create a regex object with the
     string object argument. The string argument is the
     regex specification.

     Operators

     Boolean==‐>
     The ==operator returns true if the argument is matched
     by the regex.

     Boolean!=‐>
     The !=operator returns true if the argument is not
     matched by the regex.

     Boolean<‐>
     The <operator returns true if the argument is partially
     matched by the regex.

     Methods

     Integerlength‐>
     The lengthmethod returns the length of the group vector
     when a regex match has been successful.

     Stringget‐>
     The getmethod returns by index the group sub‐string









                            ‐32‐


     when a regex match has been successful.

     Stringmatch‐>
     The matchmethod returns the first matching string of
     the argument string.

     Stringreplace‐>
     The replacemethod returns a string constructed by
     replacing all matching sub‐string ‐‐ from the first
     argument ‐‐ with the second argument string.

This chapter is a reference of the reserved container
objects with their respective builtin methods. Some of these
container objects are iterable objects. When an object is
iterable, an iterator constructor constructor is provided.
The iterable‐ppredicate returns true if the container is an
iterable object. The get‐iteratormethod can be used to
construct an object iterator. For a given iterator, the
predicates end‐pand valid‐pcan be used to check for the end
or a valid iterator position. The nextmethod move the
iterator to its next position. The prevmethod move the
iterator ‐‐ if possible ‐‐ to its previous position. The
get‐objectmethod returns the object at the current iterator
position.

     Cons
A Consinstance or simply a cons cellis a simple element used
to build linked list. The cons cell holds an object and a
pointer to the next cons cell. The cons cell object is
called carand the next cons cell is called the cdr.
Historically, carmeans Current Address Registerand cdrmeans
Current Data Register. This notation is still present here
for the sake of tradition.

     Predicate

     cons‐p

     Inheritance

     SerialIterableCollectable

     Constructors

     Cons(none)
     The Consconstructor create a default cons cell with the
     carand cdrset to nil.

     Cons(Objects...)
     The Consconstructor create a list of cons cells with
     the object arguments. Each argument object is assigned
     to the carof the cons cell while the cdris used to link
     the cell together.










                            ‐33‐


     Methods

     Objectget‐car‐>
     The get‐carmethod returns the car of the calling cons
     cell.

     Consget‐cdr‐>
     The get‐cdrmethod returns the cdr of the calling cons
     cell.

     Objectget‐cadr‐>
     The get‐cadrmethod returns the car of the cdr of the
     calling cons cell or nil if the cdr is nil.

     Objectget‐caddr‐>
     The get‐caddrmethod returns the car of the cdr of the
     cdr of the calling cons cell or nil if the cdr is nil.

     Objectget‐cadddr‐>
     The get‐cadddrmethod returns the car of the cdr of the
     cdr of the cdr of the calling cons cell or nil if the
     cdr is nil.

     Integerlength‐>
     The lengthmethod returns the length of the cons cell.
     The minimum length returned is always 1.

     Booleannil‐p‐>
     The nil‐ppredicate returns true if the car of the
     calling cons cell is nil, false otherwise.

     Booleanblock‐p‐>
     The block‐ppredicate returns true if the cons cell is
     of type block, false otherwise.

     Objectset‐car‐>
     The set‐carset the car of the calling cons cell. The
     object argument is returned by the method.

     Consset‐cdr‐>
     The set‐cdrset the cdr of the calling cons cell. The
     cons cell argument is returned by the method.

     Objectadd‐>
     The addmethod appends an object at the end of the cons
     cell chain by creating a new cons cell and linking it
     with the last cdr. The object argument is returned by
     this method.

     Objectget‐>
     The getmethod returns the car of the cons cell chain at
     a certain position specified by the integer index
     argument.










                            ‐34‐


     Enum
The Enumbuiltin object is an enumeration object. The
enumeration is constructed with the reserved keyword enumand
a list of literals or by string name with a constructor.

     Predicate

     enum‐p

     Inheritance

     Object

     Constructors

     Enum(none)
     The Enumconstructor create an empty enumeration.

     Enum(String...)
     The Enumconstructor create an enumeration from a list
     of string arguments.

     Methods

     nonereset‐>
     The resetmethod resets the enumeration and makes it
     empty.

     Integerlength‐>
     The lengthmethod returns the number of items in the
     enumeration.

     Booleanexists‐p‐>
     The exists‐ppredicate returns true if the name argument
     exists as an item. The name argument must be a lexical
     name or an exception is thrown.

     noneadd‐>
     The addmethod adds a new item to the enumeration by
     name. This method returns nil.

     Stringget‐>
     The getmethod returns an item string representation by
     index. The integer argument is the item index.

     List
The Listbuiltin object provides the facility of a double‐
link list. The Listobject is another example of iterable
object. The Listobject provides support for forward and
backward iteration.

     Predicate

     list‐p









                            ‐35‐


     Inheritance

     Iterable

     Constructors

     List(none)
     The Listconstructor create an empty list.

     List(Object...)
     The Listconstructor create a list from a list of object
     arguments.

     Methods

     Integerlength‐>
     The lengthmethod returns the length of the list. The
     minimum length is 0 for an empty list.

     Iteratorget‐iterator‐>
     The get‐iteratorreturns a forward/backward iterator for
     this list.

     Objectadd‐>
     The addmethod appends an object at the end of the list.
     The object argument is returned by this method.

     Objectinsert‐>
     The insertmethod inserts an object at the beginning of
     the list. The object argument is returned by this
     method.

     Objectget‐>
     The getmethod returns the object in the list at a
     certain position specified by the integer index
     argument.

     Strvec
The Strvecbuiltin object provides the facility of an index
array of strings. The Strvecobject is serializable object
that stores strings. The strings can be added with an
optional preference for a unique string value. The class is
similar to the general purpose Vectorclass.

     Predicate

     strvec‐p

     Inheritance

     Serial

     Constructors










                            ‐36‐


     Strvec(none)
     The Strvecconstructor create an empty string vector.

     Strvec(Integer|Boolean)
     The Strvecconstructor create a string vector with a
     predefined size or with a uniq flag. In the first form,
     the preferred vector size is given as an argument. In
     the second form, the string unicity flag is given as an
     argument.

     Boolean)Strvec(Integer
     The Strvecconstructor create a string vector with a
     predefined size and a uniq flag. The first argument is
     the preferred vector size. The second argument is the
     string unicity flag.

     Methods

     nonereset‐>
     The resetmethod resets the string vector. When the
     method is complete, the string vector is empty.

     Integerlength‐>
     The lengthmethod returns the length of the string
     vector. The minimum length is 0 for an empty vector.

     Integermin‐length‐>
     The min‐lengthmethod returns the minimum string length
     of the string vector.

     Integermax‐length‐>
     The max‐lengthmethod returns the maximum string length
     of the string vector.

     Booleanempty‐p‐>
     The empty‐ppredicate returns true if the vector is
     empty.

     Booleanactive‐p‐>
     The active‐ppredicate returns true if the vector is not
     empty. This predicate is the negation of the empty‐
     ppredicate.

     Stringget‐>
     The getmethod returns the string in the vector at a
     certain position specified by the integer index
     argument.

     noneset‐>
     The setmethod set a vector position with a string. The
     first argument is the vector index. The second argument
     is the string to set.

     Stringfirst‐>









                            ‐37‐


     The firstmethod returns the first string in the vector.

     Stringlast‐>
     The lastmethod returns the last string in the vector.

     Objectpop‐>
     The popmethod removes the first element in the string
     vector and returns it.

     Stringpop‐last‐>
     The pop‐lastmethod removes the last element in the
     string vector and returns it.

     Integerfind‐>
     The findmethod try to find a string in the vector. If
     the string is found, the vector index is returned else
     the ‐1 value is returned.

     Integerlookup‐>
     The lookupmethod try to find a string in the vector. If
     the string is found, the vector index is returned else
     an exception is raised.

     noneadd‐>
     The addmethod adds an object at the end of the vector.
     If the uniq flag is active, the string argument is not
     added if it already exists.

     Booleanexists‐p‐>
     The exists‐pmethod returns true if the string argument
     exists in the vector.

     noneremove‐>
     The removemethod removes a string from the vector by
     index or value. In the first form, the vector index is
     used as the place to remove. In the second form, the
     string argument is used as a key for removal. This
     method repacks the vector when the string has been
     removed.

     noneset‐unique‐>
     The set‐uniquemethod set the string vector unique flag.
     When the unique flag is set, there is only no string
     duplicate in the vector.

     Booleanget‐unique‐>
     The get‐uniquemethod returns the string vector unique
     flag value.

     Stringconcat‐>
     The concatmethod concatenates the string vector
     elements with a character separator. In the first form,
     with a separator character, the resulting string is the
     concatenation of the string vector elements. In the









                            ‐38‐


     second form, the resulting string is the concatenation
     of the vector elements with a character separator. If
     the character separator is nilthen no separator is
     placed.

     Vector
The Vectorbuiltin object provides the facility of an index
array of objects. The Vectorobject is another example of
iterable object. The Vectorobject provides support for
forward and backward iteration.

     Predicate

     vector‐p

     Inheritance

     SerialIterableCollectable

     Constructors

     Vector(none)
     The Vectorconstructor create an empty vector.

     Vector(Object...)
     The Vectorconstructor create a vector from a list of
     object arguments.

     Methods

     nonereset‐>
     The resetmethod reset the vector. When the method is
     complete, the vector is empty.

     Integerlength‐>
     The lengthmethod returns the length of the vector. The
     minimum length is 0 for an empty vector.

     Booleanempty‐p‐>
     The empty‐ppredicate returns true if the vector is
     empty.

     Objectget‐>
     The getmethod returns the object in the vector at a
     certain position specified by the integer index
     argument.

     Objectset‐>
     The setmethod set a vector position with an object. The
     first argument is the vector index. The second argument
     is the object to set. The method returns the object to
     set.

     Objectfirst‐>









                            ‐39‐


     The firstmethod returns the first element in the
     vector.

     Objectlast‐>
     The lastmethod returns the last element in the vector.

     Objectpop‐>
     The popmethod removes the first element in the vector
     and returns it.

     Objectpop‐last‐>
     The pop‐lastmethod removes the last element in the
     vector and returns it.

     Integerfind‐>
     The findmethod try to find an object in the vector. If
     the object is found, the vector index is returned as an
     Integer object, else nilp is returned.

     Objectadd‐>
     The addmethod appends an object at the end of the
     vector or at a certain index. In the first form, the
     object argument is added at the end of the vector. In
     the second form, the object argument is inserted in the
     vector at the specified index. In both cases, the
     object argument is returned by this method.

     Booleanexists‐p‐>
     The exists‐pmethod returns true if the object argument
     exists in the vector. This method is useful to make
     sure that only one occurrence of an object is added to
     a vector.

     noneclean‐>
     The cleanmethod removes an object from the vector by
     index and repack the vector.

     noneremove‐>
     The removemethod removes an object from the vector and
     repack the vector. If duplicate exists in the file,
     only one is removed.

     HashTable
The HashTablebuiltin object is a container object which maps
an object with a name. The hash table is dynamic and get
resized automatically when needed. The lookup method throw
an exception if the name is not found. The get method
returns nilp if the object is not found. The table can be
configured to operate in a case insensitive way. If the case
flag is changed, the table is automatically reset.

     Predicate

     hashtable‐p









                            ‐40‐


     Inheritance

     Object

     Constructors

     HashTable(none)
     The HashTableconstructor create an empty table.

     HashTable(Boolean)
     The HashTableconstructor create a table by case
     insensitive flag.

     HashTable(Integer)
     The HashTableconstructor create a table with a specific
     size.

     Boolean)HashTable(Integer
     The HashTableconstructor create a table by size and
     case insensitive flag.

     Methods

     nonereset‐>
     The resetmethod resets the table so that it becomes
     empty.

     noneadd‐>
     The addmethod adds a new object in the table by key.
     The first argument is the key used to associate the
     object in the table. The second argument is the object
     to add.

     Objectlength‐>
     The lengthreturns the number of objects in the table.

     Booleanempty‐p‐>
     The empty‐ppredicate returns true if the table is
     empty.

     noneset‐case‐flag‐>
     The set‐case‐flagmethod sets the case insensitive flag.
     The table is automatically reset when is method is
     called.

     Booleanget‐case‐flag‐>
     The get‐case‐flagmethod returns the case insensitive
     flag.

     Objectget‐>
     The getmethod returns the object associated with a key.
     If the key is not found, nil is returned.

     Objectlookup‐>









                            ‐41‐


     The lookupmethod returns the object associated with a
     key. If the key is not found, an exception is raised.

     Stringget‐key‐>
     The get‐keymethod returns the key associated with an
     entry in the table by index. If the index is out of
     range, an exception is raised.

     Objectget‐object‐>
     The get‐objectmethod returns the object associated with
     an entry in the table by index. If the index is out of
     range, an exception is raised.

     Set
The Setbuiltin object provides the facility of a uniform set
of objects. The Setobject is another example of iterable
object. The Setobject provides support for forward and
backward iteration.

     Predicate

     set‐p

     Inheritance

     SerialIterable

     Constructors

     Set(none)
     The Setconstructor create an empty set.

     Set(Object...)
     The Setconstructor create a set from a list of object
     arguments.

     Methods

     nonereset‐>
     The resetmethod reset the set. When the method is
     complete, the set is empty.

     Integerlength‐>
     The lengthmethod returns the number of elements in the
     set. The minimum length is 0 for an empty set.

     Objectadd‐>
     The addmethod appends an object in the set. If the
     object already exists in the set, it is not added
     twice. This is the main difference between a set and a
     vector. The object argument is returned by this method.

     Objectget‐>
     The getmethod return object by index.









                            ‐42‐


     Booleanempty‐p‐>
     The empty‐ppredicate returns true if the set is empty.

     Booleanexists‐p‐>
     The existspredicate returns true if the object argument
     exists in the set.

     nonemerge‐>
     The mergemethod merges the set argument into the
     calling set. If an element already exists in the set,
     it is not added.

     noneremix‐>
     The remixmethod mixes the set by randomly swapping all
     the elements. This method is useful when the set has
     been filled with a certain order by the access must be
     done randomly.

     Booleanremove‐>
     The removemethod removes the object argument from the
     set. if the object is removed, the method returns true.
     If the object is not in the set, the method returns
     false.

     Setget‐random‐subset‐>
     The get‐random‐subsetmethod returns a subset those
     cardinal is at least the size argument with a set of
     randomly chosen elements. The result set might have a
     cardinal less than the requested size if the calling
     set cardinal is less than the requested size.

     Iteratorget‐iterator‐>
     The get‐iteratorreturns an iterator for this set. The
     iterator supports forward and backward iteration.

     Queue
The Queuebuiltin object is a container used to queue and
dequeue objects. The order of entry in the queue defines the
order of exit from the queue. The queue is constructed
either empty or with a set of objects.

     Predicate

     queue‐p

     Inheritance

     Object

     Constructors

     Queue(none)
     The Queueconstructor create an empty queue.










                            ‐43‐


     Queue(Object...)
     The Queueconstructor create a queue with a list of
     object arguments

     Methods

     Objectenqueue‐>
     The enqueueadds an object in the queue and returns the
     queued object.

     Objectdequeue‐>
     The dequeuedequeue an object in the order it was
     queued.

     Objectlength‐>
     The lengthreturns the number of queued objects.

     Booleanempty‐p‐>
     The empty‐pmethod returns true if the queue is empty.

     noneflush‐>
     The flushmethod flushes the queue so that it is empty.

     Heap
The Heapbuiltin object is an object based heap class that
organizes object with respect to a key. The heap is
organized as a binary tree those root element is either the
object with the highest or the lowest key. A flag controls
whether the heap is operating in ascending or descending
mode. By default, the heap operates in ascending mode, which
means that the root node is the lowest one. The heap is
self‐resizable. The object insertion is also controlled by a
minimum and maximum key. if the key is below the minimum key
or above the maximum key, the object is not inserted.

     Predicate

     heap‐p

     Inheritance

     Object

     Constructors

     Heap(none)
     The Heapconstructor create an empty heap. By default
     the heap operates in ascending mode.

     Heap(Integer)
     The Heapconstructor create a heap with a specific size.
     By default the heap operates in ascending mode.

     Heap(Boolean)









                            ‐44‐


     The Heapconstructor create a heap with a specific mode.
     If the mode is true, the heap operates in ascending
     order. If the mode is false, the heap operates in
     descending order. In ascending order, the first object
     is the object with the lowest key.

     Boolean)Heap(Integer
     The Heapconstructor create a heap with a specific size
     and mode. The first argument is the heap size. The
     second argument is the heap mode. If the mode is true,
     the heap operates in ascending order. If the mode is
     false, the heap operates in descending order. In
     ascending order, the first object is the object with
     the lowest key.

     Methods

     noneadd‐>
     The addmethod adds a new object in the heap by key. The
     first argument is the key used to set the object
     position in the heap. The second argument is the object
     to add.

     Objectpop‐>
     The poppops the first available in the heap. If the
     heap is empty, an exception is raised.

     Objectlength‐>
     The lengthreturns the number of objects in the heap.

     Booleanempty‐p‐>
     The empty‐pmethod returns true if the heap is empty.

     nonereset‐>
     The resetmethod reset the heap so that it becomes
     empty.

     Integerget‐key‐>
     The get‐keymethod returns the key associated with an
     entry in the heap by index. If the index is out of
     range, an exception is raised.

     Objectget‐object‐>
     The get‐objectmethod returns the object associated with
     an entry in the heap by index. If the index is out of
     range, an exception is raised.

     Booleanget‐mode‐>
     The get‐modemethod returns the heap operating mode. If
     the mode is true, the heap operates in ascending order.
     If the mode is false, the heap operates in descending
     order. In ascending order, the first object is the
     object with the lowest key.










                            ‐45‐


     Booleanmin‐key‐p‐>
     The min‐key‐ppredicate returns true if a minimum key
     has been set. The get‐min‐keymethod can be used to
     retrieve the minimum key value.

     Booleanmax‐key‐p‐>
     The max‐key‐ppredicate returns true if a maximum key
     has been set. The get‐max‐keymethod can be used to
     retrieve the maximum key value.

     nonereset‐min‐key‐>
     The reset‐min‐keymethod resets the minimum key flag and
     value.

     nonereset‐max‐key‐>
     The reset‐max‐keymethod resets the maximum key flag and
     value.

     noneset‐min‐key‐>
     The set‐min‐keymethod sets the minimum key value.

     Integerget‐min‐key‐>
     The get‐min‐keymethod returns the minimum key value.

     noneset‐max‐key‐>
     The set‐max‐keymethod sets the maximum key value.

     Integerget‐max‐key‐>
     The get‐max‐keymethod returns the maximum key value.

     noneresize‐>
     The resizemethod resize the heap with a new size. if
     the size is lower than the number of elements, the
     procedure does nothing.

     Bitset
The Bitsetbuiltin object is a container for multi bit
storage. The size of the bitset is determined at
construction. With the use of an index, a particular bit can
be set, cleared and tested.

     Predicate

     bitset‐p

     Inheritance

     Object

     Constructors

     Bitset(none)
     The BitSetconstructor create an empty bitset.










                            ‐46‐


     Bitset(Integer)
     The Bitsetconstructor create a bitset those size is
     given by the integer argument.

     Bitset(String)
     The Bitsetconstructor create a bitset by parsing the
     string argument. The string can be either in the normal
     binary form with or without the 0bprefix or in
     hexadecimal form with the 0xprefix.

     Boolean)Bitset(Buffer
     The Bitsetconstructor create a bitset from a buffer
     content. Each byte in the buffer is to be placed in the
     bitset. The boolean argument is the ascending flag.
     When true the buffer bytes are used in ascending index
     order, thus making the fist byte in the buffer to be
     used as the first right byte in the bitset. When false,
     the buffer bytes are used in descending index order,
     thus making the last byte in the buffer to be used as
     the first byte in the bitset.

     Methods

     nonereset‐>
     The resetmethod reset the bitset and force the initial
     size to 0.

     Booleanmarked‐p‐>
     The marked‐ppredicate returns true if the bit is set at
     the index argument.

     noneclear‐>
     The clearmethod clears a bit by the index argument.

     nonemark‐>
     The markmethod marks a bit by the index argument.

     nonemark‐>
     The markmethod set the bit value by the index argument
     with the boolean second argument.

     noneadd‐>
     The addmethod add a bit in the bitset at the given
     position. The first argument is the bit position and
     the second argument is the bit value. The add method is
     the only method that resize a bitset.

     noneset‐>
     The setmethod set a bitset with an integer value. In
     the first form with an integer argument, the bitset is
     completely reset to a 64 bits bitset and the value set
     as an unsigned integer. In the second form with a
     string argument, the bitset is reset and the string
     argument is parsed as a binary string with or without









                            ‐47‐


     binary prefix or as a hexadecimal string.

     noneclamp‐>
     The clampmethod clamp a bitset by boolean value. The
     bitset size is determined by finding the upper bit
     index that match the boolean argument.

     Integerlength‐>
     The lengthmethod returns the length of the bitset in
     bits.

     Integerto‐byte‐>
     The to‐bytemethod maps a portion of the bitset to a
     byte at a specific position. The integer argument is
     the bit position that is mapped to the byte lsb.

     Integersubset‐>
     The subsetmethod returns a sub bitset by size.

     Integersubset‐>
     The subsetmethod returns a sub bitset by size and
     position. The first integer argument is the sub bitset
     size. The second argument is the bitset position where
     the sub bitset is extracted.

     Buffer
The Bufferbuiltin object is a byte buffer that is widely
used with i/o operations. The buffer can be constructed with
or without literal arguments. The standard methods to add or
push‐back byte or characters are available. One attractive
method is the write method which can write a complete buffer
to an output stream specified as an argument. By default,
the buffer operates in resize mode. If the buffer is
configured to operate in non‐resize mode, an exception is
raised when trying to add a character when the buffer is
full.

     Predicate

     buffer‐p

     Inheritance

     Object

     Constructors

     Buffer(none)
     The Bufferconstructor create an empty buffer. The
     buffer is configured to operate in resize mode.

     Buffer(Literal...)
     The Bufferconstructor create a buffer with a list of
     literal object arguments. Each literal argument is used









                            ‐48‐


     to produce a byte representation which is added into
     the buffer.

     Methods

     Integeradd‐>
     The addmethod adds a byte, a literal object or a buffer
     to the calling buffer. The object argument is
     automatically converted to a sequence of bytes. For a
     buffer, the entire content is copied into the buffer.
     The method returns the number of bytes added into the
     buffer.

     Byteget‐>
     The getmethod returns the next available byte in the
     buffer but do not remove it.

     Byteread‐>
     The readmethod returns the next available character and
     remove it from the buffer.

     nonereset‐>
     The resetmethod reset the entire buffer and destroy its
     contents.

     Integerlength‐>
     The lengthmethod returns the length of the buffer.

     Booleanfull‐p‐>
     The full‐ppredicate return true if the buffer is full.
     If the buffer is re‐sizeable, the method always return
     false.

     Booleanempty‐p‐>
     The empty‐ppredicate return true if the buffer is
     empty.

     Booleanresize‐p‐>
     The resize‐ppredicate return true if the buffer is re‐
     sizeable.

     Stringto‐string‐>
     The to‐stringmethod returns a string representation of
     the buffer.

     Stringformat‐>
     The formatmethod returns an octet string representation
     of the buffer.

     Integerpushback‐>
     The pushbackmethod push back a byte, a literal object
     or a buffer in the calling buffer. The object argument
     is automatically converted to a sequence of bytes. For
     a buffer, the entire content is copied into the buffer.









                            ‐49‐


     The method returns the number of byte pushbacked.

     Integerget‐host‐word‐>
     The get‐host‐wordmethod reads a word from the buffer
     and convert it to an integer. The word is assumed to be
     in network byte order and is converted into the host
     byte order before becoming an integer.

     Integerget‐host‐quad‐>
     The get‐host‐quadmethod reads a quad from the buffer
     and convert it to an integer. The quad is assumed to be
     in network byte order and is converted into the host
     byte order before becoming an integer.

     Integerget‐host‐octa‐>
     The get‐host‐octamethod reads an octa from the buffer
     and convert it to an integer. The octa is assumed to be
     in network byte order and is converted into the host
     byte order before becoming an integer.

     noneset‐resize‐>
     The set‐resizemethod set the resize flag for a
     particular buffer. This method can be used at any time.

     noneshl‐>
     The shlmethod shift left the buffer by a certain number
     of characters. The integer argument is the number of
     characters to shift.

     BlockBuffer
The BlockBufferbuiltin object is a special buffer class
designed to hold bytes in a bound or unbound way. In the
bound mode, the buffer size is know and the buffer cannot be
resized. In the unbound mode, the buffer size is unknown and
the buffer can be resized as needed. The block buffer is
designed to be loaded by various means, including data,
buffer or stream. Additionaly, the block buffer can be used
to write into another buffer or a stream by block. By
default the read and write block size is the system block
size and the default mode is the bound mode, which can be
changed by setting the buffer resize flag.

     Predicate

     block‐buffer‐p

     Inheritance

     Buffer

     Constructors

     BlockBuffer(none)
     The BlockBufferconstructor create a non‐resizable empty









                            ‐50‐


     block buffer.

     BlockBuffer(Integer)
     The BlockBufferconstructor create a non‐resizable block
     buffer. The integer argument is the block buffer size.

     Methods

     Integerread‐count‐>
     The read‐countmethod returns the number of characters
     read by the buffer. The read counter is increased
     during any read operation that might decrease the
     buffer length.

     Bytewrite‐count‐>
     The write‐countmethod returns the number of characters
     writen into the buffer.

     Integercopy‐>
     The copymethod copies an object into or from the block
     buffer. Inthe first form, a string, a buffer or an
     input stream is isued to fill the buffer. If the buffer
     is resizable, the whole contents of the objects are
     copied into the block buffer. If the buffer is not
     resizable, the copy operation stops when the buffer is
     full. The copy method consumes characters with a buffer
     or an input stream object. With an output stream
     object, the block buffer characters are consumed while
     beeing written to the output stream. The total number
     of characters copied is returned by this method. When
     using a multiple types object that implements both the
     input and output stream model, the priority is given to
     the input stream type.

     Integercopy‐input‐stream‐>
     The copy‐input‐streammethod copies an input stream into
     the block buffer. This method is similar to the
     copymethod except that it operates only with an input
     stream. Such method is usefull when using object that
     implements multiple stream types.

     Integercopy‐output‐stream‐>
     The copy‐output‐streammethod copies an output stream
     into the block buffer. This method is similar to the
     copymethod except that it operates only with an output
     stream. Such method is usefull when using object that
     implements multiple stream types.

     Property
The Propertybuiltin object is container for a name/value
pair. Generally, the property object is used within a
property list. An optional information field can be inserted
into the property.










                            ‐51‐


     Predicate

     property‐p

     Inheritance

     Serial

     Constructors

     Property(none)
     The Propertyconstructor create an empty property.

     Property(String)
     The Propertyconstructor create a property by name. The
     first argument is the property name.

     Literal)Property(String
     The Propertyconstructor create a property by name and
     value. The first argument is the property name. The
     second argument is the property value.

     StringProperty(String
     The Propertyconstructor create a property by name, info
     and value. The first argument is the property name. The
     second argument is the property info. The third
     argument is the property value.

     Methods

     noneset‐>
     The setmethod sets the property name and value. The
     first argument is the property name. The second
     argument is the property value, which is a literal
     converted to its string representation.

     noneset‐name‐>
     The set‐namemethod sets the property name.

     Stringget‐name‐>
     The get‐namemethod returns the property name.

     noneset‐info‐>
     The set‐infomethod sets the property information.

     Stringget‐info‐>
     The get‐infomethod returns the property information.

     noneset‐value‐>
     The set‐valuemethod sets the property value. The
     literal argument is converted to its string
     representation.

     Stringget‐value‐>









                            ‐52‐


     The get‐valuemethod returns the property string value.

     Booleanget‐boolean‐value‐>
     The get‐boolean‐valuemethod returns the property
     boolean value.

     Integerget‐integer‐value‐>
     The get‐integer‐valuemethod returns the property
     integer value.

     Realget‐real‐value‐>
     The get‐real‐valuemethod returns the property real
     value.

     Plist
The Plistbuiltin object is a base container class used to
manage property objects in an ordered way. The property list
operates by maintaining a vector of property object along
with a hash table that permits to find the object quickly.

     Predicate

     plist‐p

     Inheritance

     SerialIterableNameable

     Constructors

     Plist(none)
     The Plistconstructor create an empty property list.

     Plist(Boolean)
     The Plistconstructor create a property list with a case
     flag.

     Plist(String)
     The Plistconstructor create a property list by name.

     String)Plist(String
     The Plistconstructor create a property list by name and
     info.

     Methods

     noneset‐name‐>
     The set‐namemethod sets the property list name.

     noneset‐info‐>
     The set‐infomethod sets the property list info.

     Stringget‐info‐>
     The get‐infomethod returns the property list info.









                            ‐53‐


     noneadd‐>
     The addmethod add a property by object or name and
     value in the property list. In its first form the
     object is a property object. In the second form, the
     first argument is the property name and the second
     argument is the property value. In the the third form
     the first argument is the property name, the second
     argument is the property info and the this argument is
     the property value. if the property already exists an
     exception is raised.

     noneset‐>
     The setmethod add or sets the property by object or
     name and value in the property list. In the first form,
     the argument is the property itself. In the second
     form, the first argument is the property name and the
     second argument is the property value. In the third
     form, the property is set by name, info and value. If
     the property already exists, the property value is
     changed.

     Propertyget‐>
     The getmethod returns a property by index.

     nonereset‐>
     The resetmethod resets the property lists

     Booleanempty‐p‐>
     The emptyp‐predicate returns true if the property list
     is empty.

     Integerlength‐>
     The lengthmethod returns the number of properties in
     the property list.

     Booleanexists‐p‐>
     The exists‐pmethod returns true if a property exists.
     The string argument is the property name.

     Propertyfind‐>
     The findmethod finds a property by name. The string
     argument is the property name. If the property does not
     exists, nil is returned.

     Propertylookup‐>
     The lookupmethod finds a property by name. The string
     argument is the property name. If the property does not
     exists, an exception is raised.

     Stringget‐value‐>
     The get‐valuemethod returns the property value. The
     string argument is the property name. If the property
     does not exist, an exception is raised.










                            ‐54‐


     PrintTableto‐print‐table‐>
     The to‐print‐tablemethod converts the property list
     into a print table. The print table can be formated
     with the property info and value. In the first form,
     the print table is formated without the info field in
     normal value. In the second form, the boolean flag
     controls whther or not the info field is added in the
     table. In the third form, the second boolean value
     controls whther or not the real property value are
     converted in scientific notation.

This chapter is a reference of the reserved special objects
with their respective built‐in methods. Special objects are
those objects which interact with the interpreter.

     Object
The base object Objectprovides several methods which are
common to all objects.

     Methods

     Stringrepr‐>
     The reprmethod returns the object name in the form of a
     string. The result string is called the representation
     string.

     nonerdlock‐>
     The rdlockmethod try to acquire the object in read‐lock
     mode. If the object is currently locked in write mode
     by another thread, the calling thread is suspended
     until the lock is released.

     nonewrlock‐>
     The wrlockmethod try to acquire the object in write‐
     lock mode. If the object is currently locked by another
     thread, the calling thread is suspended until the lock
     is released.

     noneunlock‐>
     The unlockmethod try to unlock an object. An object
     will be unlocked if and only if the calling thread is
     the one who acquired the lock.

     Objectclone‐>
     The clonemethod returns a clone of the calling object.
     If the object cannot be cloned, an exception is raised.

     Interp
The Interpis the interpreter object which is automatically
bounded for each executable program. There is no constructor
for this object. The current interpreter is bounded to the
interpreserved symbol.











                            ‐55‐


     Predicate

     interp‐p

     Inheritance

     Runnable

     Constants

     argv
     The argvdata member holds the interpreter argument
     vector. The vector is initialized when the interpreter
     is created. Each argument is stored as a string object.

     os‐name
     The os‐namedata member holds the operating system name.
     The data member evaluates as a string.

     os‐type
     The os‐typedata member holds the operating system type.
     The data member evaluates as a string.

     version
     The versiondata member holds the full engine version.
     The data member evaluates as a string.

     program‐name
     The program‐namedata member holds the interpreter
     program name. The data member evaluates as a string.

     major‐version
     The major‐versiondata member holds the interpreter
     major revision number. The data member evaluates as an
     integer.

     minor‐version
     The minor‐versiondata member holds the interpreter
     minor revision number. The data member evaluates as an
     integer.

     patch‐version
     The patch‐versiondata member holds the interpreter
     patch revision number. The data member evaluates as an
     integer.

     afnix‐uri
     The afnix‐uridata member holds the official uri. The
     data member evaluates as a string.

     machine‐size
     The machine‐sizedata member holds the interpreter
     machine size expressed in bits. Most of the time, the
     machine size is either 32 or 64 bits. If something else









                            ‐56‐


     is returned, it certainly reflects an exotic platform.

     loader
     The loaderdata member holds the interpreter library
     loader. Under normal circumstances, the library loader
     should not be used and the standard interp:libraryform
     should be used.

     resolver
     The resolverdata member holds the interpreter resolver.
     The resolver can be used to add dynamically a librarian
     or a directory to the interpreter module resolver.

     Methods

     Booleanload‐>
     The loadmethod opens a file those name is the method
     argument and executes each form in the file by doing a
     read‐eval loop. When all forms have been executed, the
     file is closed and the method returns true. In case of
     exception, the file is closed and the method returns
     false.

     Librarylibrary‐>
     The librarymethod opens a shared library and a returns
     a shared library object.

     Threadlaunch‐>
     The launchmethod executes the form argument in a normal
     thread. The normal thread is created by cloning the
     current interpreter. In the first form, a thread object
     is created by the method and return when the thread as
     been launched. In the second form, a thread is started
     by binding a form to the thread object.

     Booleandaemon‐>
     The dameonmethod put the running interpreter in dameon
     mode. A new detached processed is spawned with the
     interpreter attached to it. The boolean result
     indicates whether or not the operation was successful.

     noneset‐epsilon‐>
     The set‐epsilonmethod sets the interpreter epsilon
     which corresponds to the real precision. The real
     precisionis used by the ?=operator to compare real
     values.

     Realget‐epsilon‐>
     The get‐real precisionmethod returns the interpreter
     epsilon which correspond to the real precision. The
     real‐precisionis used by the ?=operator to compare real
     values.

     Interpdup‐>









                            ‐57‐


     The dupmethod returns a clone of the current
     interpreter by binding the terminal steam argument.
     Without argument, a new terminal object is
     automatically created and bound to the newly created
     interpreter.

     Booleanloop‐>
     The loopmethod executes the interpreter main loop by
     reading the interpreter input stream. The loop is
     finished when the end‐of‐stream is reached with the
     input stream. The method returns a boolean flag to
     indicate whether or not the loop was successful.

     noneset‐primary‐prompt‐>
     The set‐primary‐promptmethod sets the interpreter
     terminal primary prompt which is used during the
     interpreter main loop.

     noneset‐secondary‐prompt‐>
     The set‐secondary‐promptmethod sets the interpreter
     terminal secondary prompt which is used during the
     interpreter main loop.

     Stringget‐primary‐prompt‐>
     The get‐primary‐promptmethod returns the interpreter
     terminal primary prompt.

     Stringget‐secondary‐prompt‐>
     The get‐secondary‐promptmethod returns the interpreter
     terminal secondary prompt.

     Stringread‐line‐>
     The read‐linemethod reads a line from the interpreter
     terminal. If no terminal is bound to the interpreter,
     the empty string is returned. In the first form, a line
     is read after printing the primary prompt. In the
     second form, a boolean flag controls the prompt disply,
     which can be primary or secondary.

     Stringread‐passphrase‐>
     The read‐passphrasemethod reads a pass‐phrase from the
     interpreter terminal. If no terminal is bound to the
     interpreter, the empty string is returned. With a
     string argument, the string is displayed as a prompt,
     before reading the passphrase.

     Thread
The Threadobject is a special object which acts as a thread
descriptor. Such object is created with the launchreserved
keyword.

     Predicate

     thread‐p









                            ‐58‐


     Inheritance

     Object

     Constructors

     Thread(none)
     The Threadconstructor create a default thread object
     without any form bound to it. The object can be later
     used with the launchcommand.

     Methods

     noneend‐p‐>
     The end‐ppredicate returns true if the thread argument
     has finished. This predicate indicates that the thread
     result is a valid one.

     nonewait‐>
     The waitmethod suspends the calling thread until the
     thread argument as completed. The waitmethod is the
     primary mechanism to detect a thread completion.

     Objectresult‐>
     The resultmethod returns the thread result. If the
     thread is not completed, the nilvalue is returned.
     However, this method should not be used to check if a
     thread has completed and the waitmethod must be used
     because a thread result might be nil.

     Condvar
The condition variable Condvarobject is a special object
which provides a mean of synchronization between one and
several threads. The condition is said to be false unless it
has been marked. When a condition is marked, all threads
waiting for that condition to become true are notified and
one thread is activated with that condition.

     Predicate

     condvar‐p

     Inheritance

     Object

     Constructors

     Condvar(none)
     The Condvarconstructor creates a default condition
     variable.

     Methods










                            ‐59‐


     nonelock‐>
     The lockmethod locks the condition variable mutex. If
     the mutex is already locked, the calling thread is
     suspended until the lock is released. When the method
     returns, the resumed thread owns the condition variable
     lock. It is the thread responsibility to reset the
     condition variable and unlock it.

     nonemark‐>
     The markmethod marks the condition variable and notify
     all pending threads of such change. The mark method is
     the basic notification mechanism.

     nonewait‐>
     The waitmethod waits for a condition variable to be
     marked. When such condition occurs, the suspended
     thread is run. When the method returns, the resumed
     thread owns the condition variable lock. It is the
     thread responsibility to reset the condition variable
     and unlock it.

     nonereset‐>
     The resetmethod acquires the condition variable mutex,
     reset the mark, and unlock it. If the lock has been
     taken, the calling thread is suspended.

     noneunlock‐>
     The unlockmethod unlock the condition variable mutex.
     This method should be used after a call to lockor wait.

     nonewait‐unlock‐>
     The wait‐unlockmethod wait until a condition variable
     is marked. When such condition occurs, the suspended
     thread is run. Before the method returns, the condition
     variable is reset and the mutex unlocked. With two
     threads to synchronize, this is the preferred method
     compared to wait.

     Lexical
The Lexicalobject is a special object built by the reader. A
lexical name is also a literal object. Although the best way
to create a lexical name is with a form, the lexical object
can also be constructed with a string name. A lexical name
can be mapped to a symbol by using the mapmethod.

     Predicate

     lexical‐p

     Inheritance

     Literal











                            ‐60‐


     Constructors

     Lexical(none)
     The Lexicalconstructor create an empty lexical object
     which evaluates to nil.

     Lexical(String)
     The Lexicalconstructor create a lexical object using
     the string argument as the lexical name.

     Methods

     Objectmap‐>
     The mapmethod returns the object that is mapped by the
     lexical name. Most of the time, a symbol object is
     returned since it is the kind of object stored in a
     nameset. Eventually the mapping might returns an
     argument object if used inside a closure.

     Qualified
The Qualifiedobject is a special object built by the reader.
A qualified object is similar to a lexical object. It is
also a literal object. Like a lexical name, a qualified name
can be created with a form or by direct construction with a
name. Like a lexical name, the mapmethod can be used to
retrieve the symbol associated with that name.

     Predicate

     qualified‐p

     Inheritance

     Literal

     Constructors

     Qualified(none)
     The Qualifedconstructor create an empty qualified name
     object which evaluates to nil.

     Qualified(String)
     The Qualifiedconstructor create a qualified name object
     using the string argument as the qualified name. The
     name is parse for qualified name syntax adherence.

     Methods

     Objectmap‐>
     The mapmethod returns the object that is mapped by the
     qualified name. Most of the time, a symbol object is
     returned since it is the kind of object stored in a
     nameset. Eventually the mapping might returns an
     argument object if used inside a closure.









                            ‐61‐


     Symbol
The Symbolobject is a special object used by nameset to map
a name with an object. Generally a symbol is obtained by
mapping a lexical or qualified name. As an object, the
symbol holds a name, an object and a constant flag. The
symbol name cannot be changed since it might introduce
inconsistencies in the containing nameset. On the other
hand, the constant flagand the object can be changed. A
symbol is a literal object. A symbol that is not bounded to
a nameset can be constructed dynamically. Such symbol is
said to be not interned.

     Predicate

     symbol‐p

     Inheritance

     Literal

     Constructors

     Symbol(String)
     The Symbolconstructor create a symbol by name. The
     associated object is marked as nil.

     Object)Symbol(String
     The Symbolconstructor create a symbol by name and bind
     the object argument to the symbol.

     Methods

     Booleanget‐const‐>
     The get‐constmethod returns the symbol const flag. If
     the flag is true, the symbol object cannot be changed
     unless that flags is reset with the set‐constmethod.

     noneset‐const‐>
     The set‐constmethod set the symbol const flag. This
     method is useful to mark a symbol as const or to make a
     const symbol mutable.

     Objectget‐object‐>
     The get‐objectmethod returns the symbol object.

     noneset‐object‐>
     The set‐objectmethod set the symbol object. The object
     can be obtained by evaluating the symbol.

     Closure
The Closureobject is a special object that represents a
lambda or gamma expression. A closure is represented by a
set of arguments, a set of closed variables and a form to
execute. A boolean flag determines the type of closure. The









                            ‐62‐


closure predicate lambda‐preturns true if the closure is a
lambda expression. Closed variables can be defines and
evaluated with the use of the qualified name mechanism.
Closure mutation is achieved with the add‐argumentand set‐
formmethod. An empty closure can be defined at construction
as well.

     Predicate

     closure‐p

     Inheritance

     Object

     Constructors

     Closure(none)
     The Closureconstructor create a default closure. When
     the closure is created, a local set of arguments and
     closed variables is generated. Note that such local set
     is dynamic. There is no restriction to reconfigure a
     particular lambda at run‐time. The difference between a
     lambda and a gamma expression resides in the nameset
     binding when the closure is called. With a lambda, the
     closure nameset parent is the calling nameset. With a
     gamma expression, the parent nameset is always the top‐
     level interpreter nameset. Note also, that the symbol
     selfis automatically bounded for this closure.

     Closure(Boolean)
     The Closureconstructor create a closure which acts as
     lambda expression if the boolean argument is true. If
     the boolean argument is false, the closure will behave
     like a gamma expression.

     Methods

     Booleangamma‐p‐>
     The gamma‐ppredicate returns true if the closure is a
     gamma expression. The predicate returns true for a
     lambda expression.

     Booleanlambda‐p‐>
     The lambda‐ppredicate returns true if the closure is a
     lambda expression. The predicate returns false for a
     gamma expression.

     Objectget‐form‐>
     The get‐formmethod returns the closure form object.

     noneset‐form‐>
     The set‐formmethod sets the closure form object.










                            ‐63‐


     noneadd‐argument‐>
     The add‐argumentmethod adds an argument to the closure.
     The argument object can be either a string, a lexical
     object of a simple form that defines a constant lexical
     name.

     Librarian
The Librarianobject is a special object that read or write a
librarian. Without argument, a librarian is created for
writing purpose. With one file name argument, the librarian
is created for reading.

     Predicate

     librarian‐p

     Inheritance

     Nameable

     Constructors

     Librarian(none)
     The Librarianconstructor creates a librarian for
     writing. Initially, the librarian is empty and files
     must be added with the addmethod.

     Librarian(String)
     The Librarianconstructor creates a librarian for
     reading using the name as the librarian file name.

     Methods

     noneadd‐>
     The addmethod adds a file into the librarian. The
     librarian must have been opened in write mode.

     nonewrite‐>
     The writemethod writes a librarian to a file those name
     is the argument.

     Integerlength‐>
     The lengthmethod returns the number of file in the
     librarian. This method work, no matter how the
     librarian has been opened.

     Booleanexists‐p‐>
     The exists‐ppredicate returns true if the file argument
     exists in the librarian.

     InputMappedextract‐>
     The extractmethod returns an input stream mapped to the
     file name argument.










                            ‐64‐


     Resolver
The Resolverobject is a special object that gives the
ability to open a file based on a file path resolver. The
resolver maintains a list of valid path and returns an input
stream for a file on demand.

     Predicate

     resolver‐p

     Inheritance

     Object

     Constructors

     Resolver(none)
     The Resolverconstructor creates a default resolver.
     Once created, the addmethod can be used to add path to
     the resolver.

     Methods

     noneadd‐>
     The addmethod adds a path into the resolver. The path
     can points either to a directory or a librarian.

     InputStreamlookup‐>
     The lookupmethod resolves the file name argument and
     returns an input stream for that file.

     Stringto‐string‐>
     The to‐stringmethod resolves the file name argument and
     returns a string respresentation for that file.

     Booleanvalid‐p‐>
     The valid‐ppredicate returns true if the file name
     argument can be resolved. If the file name can be
     resolved, the lookupmethod can be called to get an
     input stream.

     PrintTable
The PrintTable class is a formatting class for tables. The
table is constructed with the number of columns ‐‐ default
to 1 ‐‐ and eventually the number of rows. Once the table is
created, element are added to the table with the addmethod.
Specific table element can be set with the setmethod. The
class provide a formatmethod those default is to print the
table on the interpreter standard output. With an output
stream argument or a buffer, the table is formatted to these
objects. The table formatting includes an optional column
width, a filling character and a filling direction flag. By
default, the column width is 0. This means that the column
width is computed as the maximum length of all column









                            ‐65‐


elements. If the column width is set with the set‐column‐
sizemethod, the string element might be truncated to the
left or right ‐‐ depending on the filling flag ‐‐ to fit the
column width. Each table element can also be associated with
a tag. The tag‐pmethod can be used to test for the presence
of a tag, while the set‐tagand get‐tagmethods can be used to
set or get the tag by row and column coordinates.

     Predicate

     print‐table‐p

     Inheritance

     Object

     Constructors

     PrintTable(none)
     The PrintTableconstructor creates a default table with
     one column.

     PrintTable(Integer)
     The PrintTableconstructor creates a table with a pre‐
     defined number of columns specified in the constructor
     argument.

     Integer)PrintTable(Integer
     The PrintTableconstructor creates a table with a pre‐
     defined number of columns and rows specified in the
     constructor arguments.

     Methods

     Booleanhead‐p‐>
     The head‐ppredicate returns true if the table header is
     defined.

     noneadd‐head‐>
     The add‐headmethod add to the table header the string
     arguments. The number of arguments must be equal to the
     number of columns.

     Stringget‐head‐>
     The get‐headmethod returns a table header element by
     column index. The integer argument is the header row
     index.

     noneset‐head‐>
     The set‐headmethod sets a table header element by
     column index. The first argument is the header column
     index and the second is the header string value to set.

     Integeradd‐>









                            ‐66‐


     The addmethod serves several purposes. Without
     argument, a new row is added and the row index is
     returned. The row index can be later used with the
     setmethod to set a particular table element. With one
     or several literal arguments, those length must match
     the number of columns, a new row is created and those
     arguments added to the table. The row number is also
     returned.

     Stringget‐>
     The getmethod returns a particular table element by row
     and column. The first argument is the table row index
     and the second is the table column index.

     noneset‐>
     The setmethod sets a particular table element by row
     and column. The first argument is the table row index
     and the second is the table column index. The last
     argument is a literal object that is converted to a
     string prior its insertion.

     Booleantag‐p‐>
     The tag‐ppredicate returns true if a tag is present at
     a particular table element. The first argument is the
     table row index and the second is the table column
     index.

     noneset‐tag‐>
     The set‐tagmethod sets a particular table tag by row
     and column. The first argument is the table row index
     and the second is the table column index. The last
     argument is the tag value.

     Stringget‐tag‐>
     The get‐tagmethod returns a particular table tag by row
     and column. The first argument is the table row index
     and the second is the table column index.

     none|Stringdump‐>
     The dumpmethod dumps the table to an output stream or a
     buffer. Without argument, the default interpreter
     output stream is used. With an integer argument, the
     specified row is used and a string is returned. With a
     buffer or an output stream, the whole table is written
     and nothing is returned.

     nonemerge‐>
     The mergemethod merge a table into the calling one. In
     the first for, only the table content is merged. In the
     second form, the boolean arguments controls whether the
     header and footer shall be merge as well.

     none|Stringformat‐>
     The formatmethod writes the formatted table to an









                            ‐67‐


     output stream or a buffer. Without argument, the
     default interpreter output stream is used. With an
     integer argument, the specified row is used and a
     string is returned. With a buffer or an output stream,
     the whole table is written and nothing is returned.

     Integerget‐rows‐>
     The get‐rowsmethod returns the number of rows in the
     table.

     Integeradd‐columns‐>
     The add‐columnsmethod adds 1 or more columns at the end
     of the table.

     Integerget‐columns‐>
     The get‐columnsmethod returns the number of columns in
     the table.

     noneset‐column‐size‐>
     The set‐column‐sizemethod sets the desired width for a
     particular column. The first argument is the column
     index and the second argument is the column width.If 0
     is given, the column width is computed as the maximum
     of the column elements.

     Integerget‐column‐size‐>
     The get‐column‐sizemethod returns the desired width for
     a particular column.

     noneset‐column‐fill‐>
     The set‐column‐fillmethod sets the filling character
     for a particular column. The first argument is the
     column index and the second argument is a character to
     use when filling a particular column element. The
     default filling character is the blank character.

     Characterget‐column‐fill‐>
     The get‐column‐fillmethod returns the filling character
     for a particular column.

     noneset‐column‐direction‐>
     The set‐column‐directionmethod sets the direction flag
     for a particular column. The first argument is the
     column index and the second argument is a boolean. A
     false value indicates a filling by the left while a
     true value indicates a filling by the right. The column
     filling character is used for this operation.

     Booleanget‐column‐direction‐>
     The get‐column‐directionmethod returns the direction
     flag for a particular column.

     Logger
The Looger class is a message logger that stores messages in









                            ‐68‐


a buffer with a level. The default level is the level 0. A
negative level generally indicates a warning or an error
message but this is just a convention which is not enforced
by the class. A high level generally indicates a less
important message. The messages are stored in a circular
buffer. When the logger is full, a new message replace the
oldest one. By default, the logger is initialized with a 256
messages capacity that can be resized.

     Predicate

     logger‐p

     Inheritance

     Object

     Constructors

     Logger(none)
     The Loggerconstructor creates a default logger.

     Logger(Integer)
     The Loggerconstructor creates a logger with a specific
     size specified as the constructor argument.

     Logger(String)
     The Loggerconstructor creates a logger with an
     information argument. The information string is later
     used to format the logged messages.

     String)Logger(Integer
     The Loggerconstructor creates a logger with a specific
     size and an information argument. The first argument is
     the logger size. The second argument is the information
     string. The information string is later used to format
     the logged messages.

     Methods

     noneadd‐>
     The addmethod adds a message in the logger. With one
     argument, the method take a single string message. with
     two arguments, the first arguments is the message and
     the second argument is the message level.

     nonereset‐>
     The resetmethod reset the logger class by removing all
     messages.

     Integerlength‐>
     The lengthmethod returns the number of messages stored
     in the logger object.










                            ‐69‐


     noneresize‐>
     The resizemethod resize the logger class by increasing
     the size of the message buffer. The old messages are
     kept during the resizing operation.

     noneset‐info‐>
     The set‐infomethod sets the logger information string.
     The information string is used by the derived classes
     when a message is printed.

     Stringget‐info‐>
     The get‐infomethod returns the logger information
     string. The information string is used by the derived
     classes when a message is printed.

     noneset‐default‐level‐>
     The set‐default‐levelmethod sets the default level use
     for storing message. This parameter is used with the
     addmethod in conjunction with the message argument.
     When the message level is specified, the default
     message level is ignored.

     Integerget‐default‐level‐>
     The get‐default‐levelmethod returns the default message
     level used by the logger. The default message level is
     used by the addmethod when the message level is not
     specified directly.

     Stringget‐message‐>
     The get‐messagemethod returns a logger message by
     index. The integer argument is the message index.

     Stringget‐full‐message‐>
     The get‐full‐messagemethod returns a fully formatted
     logger message by index. The integer argument is the
     message index. The message includes the time and
     contents.

     Integerget‐message‐time‐>
     The get‐message‐timemethod returns the logger message
     time by index. The integer argument is the message
     index.

     Integerget‐message‐level‐>
     The get‐message‐levelmethod returns the logger message
     level by index. The integer argument is the message
     index.

     noneset‐output‐stream‐>
     The set‐output‐streammethod set the logger output
     stream. The output stream can be either an output
     stream or an output file name.











                            ‐70‐


     Counter
The Counter class is a mechanism designed to count integer
both upward or downward. The counter is initialized with a
start and end value. With a single value, the start value is
set to 0 and the counter direction determined by the end
value. The counter object is also a literal object, meaning
that it can be directly printed. The object is also designed
to be used directly in a loop.

     Predicate

     counter‐p

     Inheritance

     Literal

     Constructors

     Counter(none)
     The Counterconstructor creates a default counter.
     Since, both start and end values are initialized to 0,
     this object will never count.

     Counter(Integer)
     The Counterconstructor creates an upward counter. If
     the argument value, the initial counter value is the
     argument value and the counter will counter from the
     value to 0. If the argument value is positive, the
     final counter value is the argument value and the
     counter will count from 0 to this value.

     Integer)Counter(Integer
     The Counterconstructor creates a counter with an
     initial and final values. Depending on the initial and
     final value the counter might be an upward or a
     downward counter.

     Methods

     nonereset‐>
     The resetmethod reset the counter to its start value.

     Booleanstep‐p‐>
     The step‐ppredicate checks if the counter can be moved
     by one position. If the test is successful, the counter
     is moved upward or downward. the method returns the
     result of the test.

     Booleanvalid‐p‐>
     The valid‐ppredicate returns true if the counter can be
     moved by one position.











                            ‐71‐


     Lexer
The Lexerclass is the lexical analyzer for the writing
system. The lexical analyzer consumes characters from an
input stream and produces tokens. From a token, it is
possible to derive an object in the form of a constant
object which can be evaluated to a literal or to another
object in the presence of a lexical or qualified object. The
lexical analyzer is integrated inside the form reader. As an
object it is possible to use it when it becomes necesary to
parse strings.

     Predicate

     lexer‐p

     Inheritance

     Object

     Methods

     Tokenget‐token‐>
     The get‐tokenmethod returns the next available token.

     Objectget‐object‐>
     The get‐objectmethod returns the next available object.

     Integerget‐line‐number‐>
     The get‐line‐numbermethod returns the token line number
     which is the current line number under processing.

     Former
The Formerclass is an abstract class used to derive form
reader. The class defines only a method parsewhich returns a
form. The method getlnumreturns the form line number.

     Predicate

     former‐p

     Inheritance

     Object

     Methods

     Formparse‐>
     The parsemethod returns the next available form.

     Integerget‐line‐number‐>
     The get‐line‐numbermethod returns the form line number
     which is the current line number under processing.











                            ‐72‐


     Reader
The Readerclass is the general purpose form reader which
supports the writing system syntax. The reader is primarily
used to parse file or be run interactively. The reader
consumes tokens until a complete form can be built. The form
does not have any particular meaning and must be post
processed by the application.

     Predicate

     reader‐p

     Inheritance

     FormerNameable

     Constructors

     Reader(none)
     The Readerconstructor creates a default reader.

     Reader(String|InputStream)
     The Readerconstructor creates a reader by string or
     input stream. In the first form, a string is mapped
     into a string stream which is used by the reader to
     parse form. In the second form, an input stream is
     bound to the reader to parse forms.

     Loader
The Loaderclass is a library loader. The loader keep a list
of loaded libraries. This class is bound to the interpreter
and cannot be constructed. Use the interp:loaderto access
the interpreter loader. for safety reason, it is not
possible to add a libray to the loader. The interpreter
method interp:libraryis the prefered method to access the
loader.

     Predicate

     loader‐p

     Inheritance

     Object

     Methods

     Integerlength‐>
     The lengthmethod returns the number of loaded
     libraries.

     Libraryget‐>
     The getmethod returns a library object by index.










                            ‐73‐


     Booleanexists‐p‐>
     The exists‐ppredicate returns true if a library is
     already loaded in the interpreter.