:THE-CLASS

Purpose

Either finds exactly one class with the given properties, or else creates one with those properties.

Parameters

(variable superclass)
A variable to be bound to the found or new class and the superclass of that class.
clause*
Clauses to be asserted about the new class. If a (:NAME ...) clause is included, the new class will be created with the name given in that clause.

Examples

  (:THE-CLASS (?t1 Vehicles) (:NAME ?t1 "Trucks"))
  (:THE-CLASS (?new Animals)  (:NAME ?new "Cats") (enemyOf ?new Dogs))

Success criteria

Succeeds if exactly one class is found or successfully created.

Failure criteria

Fails if a class can not be found or created.

Notes

The superclass of the new class must already exist.

If a class with the stated properties can not be found, this command is equivalent to :ADD-CLASS.

Related commands


Back to...

Algernon commands
Algernon Documentation Central
Algernon home page