8 Definitions

This set of definitions, which are be used throughout this document, is self-consistent but might not agree with notions accepted in other language definitions. The terms are defined in alphabetical rather than dependency order and where a definition uses a term defined elsewhere in this section it is written in italics. Names in courier font refer to entities defined in the language.

8.1 abstract class

A Class that by definition has no direct instances.

8.2 applicable method

A method is applicable for a particular set of arguments if each element in its domain is a superclass of the class of the corresponding argument.

8.3 binding

A location containing a value.

8.4 class

A class is an object which describes the structure and behaviour of a set of objects which are its instances. A class object contains inheritance information and a set of slot descriptions which define the structure of its instances. A class object is an instance of a metaclass. All classes in EULISP are subclasses of <object>, and all instances of <class> are classes.

8.5 class precedence list

Each class has a linearised list of all its super-classes, direct and indirect, beginning with the class itself and ending with the root of the inheritance graph, the class <object>. This list determines the specificity of slot and method inheritance. A class’s class precedence list may be accessed through the function class-precedence-list. The rules used to compute this list are determined by the class of the class through methods of the generic function compute-class-precedence-list.

8.6 class option

A keyword and its associated value applying to a class appearingin a class definition form, for example: the predicate keyword and its value, which defines a predicate function for the class being defined.

8.7 closure

A first-class function with free variables that are bound in the lexical environment. Such a function is said to be “closed over” its free variables. Example: the function returned by the expression (let ((x 1)) #’(lambda () x)) is a closure since it closes over the free variable x.

8.8 congruent

A constraint on the form of the lambda-list of a method, which requires it to have the same number of elements as the generic function to which it is to be attached.

8.9 continuation

A continuation is a function of one parameter which represents the rest of the program. For every point in a program there is the remainder of the program coming after that point; this can be viewed as a function of one argument awaiting the result of that point. The current continuation is the continuation that would be derived from the current point in a program’s execution, see let/cc.

8.10 converter function

The generic function associated with a class (the target) that is used to project an instance of another class (the source) to an instance of the target.

8.11 defining form

Any form or syntax expression expanding into a form whose operator is a defining operator.

8.12 defining operator

One of defclass, defcondition, defconstant, defgeneric, deflocal, defsyntax, defun, or defglobal.

8.13 direct instance

A direct instance of a class class1 is any object whose most specific class is class1.

8.14 direct subclass

A class1 is a direct subclass of class2 if class1 is a subclass of class2, class1 is not identical to class2, and there is no other class3 which is a superclass of class1 and a subclass of class2.

8.15 direct superclass

A direct superclass of a class class1 is any class for which class1 is a direct subclass.

8.16 dynamic environment

The inner and top dynamic environment, taken together, are referred to as the dynamic environment.

8.17 dynamic extent

A lifetime constraint, such that the entity is created on control entering an expression and destroyed when control exits the expression. Thus the entity only exists for the time between control entering and exiting the expression.

8.18 dynamic scope

An access constraint, such that the scope of the entity is limited to the dynamic extent of the expression that created the entity.

8.19 extent

That lifetime for which an entity exists. Extent is constrained to be either dynamic or indefinite.

8.20 first-class

First-class entities are those which can be passed as parameters, returned from functions, or assigned into a variables.

8.21 function

A function is either a continuation, a simple function or a generic function.

8.22 generic function

Generic functions are functions for which the method executed depends on the class of its arguments. A generic function is defined in terms of methods which describe the action of the generic function for a specific set of argument classes called the method’s domain.

8.23 identifier

An identifier is the syntactic representation of a variable.

8.24 indefinite extent

A lifetime constraint, such that the entity exists for ever. In practice, this means for as long as the entity is accessible.

8.25 indirect instance

An indirect instance of a class class1 is any object whose class is an indirect subclass of class1.

8.26 indirect subclass

A class1 is an indirect subclass of class2 if class1 is a subclass of class2, class1 is not identical to class2, and there is at least one other class3 which is a superclass of class1 and a subclass of class2.

8.27 inheritance graph

A directed labelled acyclic graph whose nodes are classes and whose edges are defined by the direct subclass relations between the nodes. This graph has a distinguished root, the class <object>, which is a superclass of every class.

8.28 inherited slot description

A slot description is inherited for a class1 if the slot description is defined for another class2 which is a direct or indirect superclass of class1.

8.29 keyword

A keyword used in an initlist to mark the value of some slot or additional information. Used in conjunction with make and the other object initialization functions to initialize the object. An keyword may be declared for a slot in a class definition form using the keyword slot-option or the keywords class-option.

8.30 default

A form which is evaluated to produce a default initial slot value. Defaults are closed in their lexical environments and the resulting closure is called a default-function. A default may be declared for a slot in a class definition form using the default slot-option.

8.31 default-function

A function of no arguments whose result is used as the default value of a slot. default-functions capture the lexical environment of a default declaration in a class definition form.

8.32 initlist

A list of alternating keywords and values which describes some not-yet instantiated object. Generally the keywords correspond to the keywords of some class.

8.33 inner dynamic

Inner dynamic bindings are created by dynamic-let, referenced by dynamic and modified by dynamic-setq. Inner dynamic bindings extend—and can shadow—the dynamically enclosing dynamic environment.

8.34 inner lexical

Inner lexical bindings are created by lambda and let/cc, referenced by variables and modified by setq. Inner lexical bindings extend—and can shadow—the lexically enclosing lexical environment. Note that let/cc creates an immutable binding.

8.35 instance

Every object is the instance of some class. An instance thus describes an object in relation to its class. An instance takes on the structure and behaviour described by its class. An instance can be either direct or indirect.

8.36 instantiation graph

A directed graph whose nodes are objects and whose edges are defined by the instance relations between the objects. This graph has only one cycle, an edge from <class> to itself. The instantiation graph is a tree and <class> is the root.

8.37 lexical environment

The inner and top lexical environment of a module are together referred to as the lexical environment except when it is necessary to distinguish between them.

8.38 lexical scope

An access constraint, such that the scope of the entity is limited to the textual region of the form creating the entity. See also lexically closer and shadow.

8.39 syntax operator

A syntax operator is distinguished by when it is used: syntax operators are only used during the syntax expansion of modules to transform expressions.

8.40 metaclass

A metaclass is a class object whose instances are themselves classes. All metaclasses in EULISP are instances of <class>, which is an instance of itself. All metaclasses are also subclasses of <class>. <class> is a metaclass.

8.41 method

A method describes the action of a generic-function for a particular list of argument classes called the method’s domain. A method is thus said to add to the behaviour of each of the classes in its domain. Methods are not functions but objects which contain,among other information, a function representing the method’s behaviour.

8.42 method function

A function which implements the behaviour of a particular method. Method functions have special restrictions which do not apply to all functions: their formal parameter bindings are immutable, and the special operators call-next-method and next-method? are only valid within the lexical scope of a method function.

8.43 method specificity

A domain domain1 is more specific than another domain2 if the first class in domain1 is a subclass of the first class in domain2, or, if they are the same, the rest of domain1 is more specific than the rest of domain2.

8.44 multi-method

A method which specializes on more than one argument.

8.45 new instance

A newly allocated instance, which is distinct, but can be isomorphic to other instances.

8.46 reflective

A system which can examine and modify its own state is said to be reflective. EULISP is reflective to the extent that it has explicit class objects and metaclasses, and user-extensible operations upon them.

8.47 scope

That part of the extent in which a given variable is accessible. Scope is constrained to be lexical, dynamic or indefinite.

8.48 self-instantiated class

A class which is an instance of itself. In EULISP, <class> is the only example of a self-instantiated class.

8.49 setter function

The function associated with the function that accesses a place in an entity, which changes the value stored in that place.

8.50 simple function

A function comprises at least: an expression, a set of identifiers, which occur in the expression, called the parameters and the closure of the expression with respect to the lexical environment in which it occurs, less the parameter identifiers. Note: this is not a definition of the class <simple-function>.

8.51 slot

A named component of an object which can be accessed using the slot’s accessor. Each slot of an object is described by a slot description associated with the class of the object. When we refer to the structure of an object, this usually means its set of slots.

8.52 slot description

A slot description describes a slot in the instances of a class. This description includes the slot’s name, its logical position in instances, and a way to determine its default value. A class’s slot descriptions may be accessed through the function class-slots. A slot description can be either direct or inherited.

8.53 slot option

A keyword and its associated value applying to one of the slots appearing in a class definition form, for example: the accessor keyword and its value, which defines a function used to read or write the value of a particular slot.

8.54 slot specification

A list of alternating keywords and values (starting with a keyword) which represents a not-yet-created slot description during class initialization.

8.55 special form

Any form or syntax expression expanding into a form whose operator is a special operator. They are semantic primitives of the language and in consequence, any processor (for example, a compiler or a code-walker) need be able to process only the special forms of the language and compositions of them.

8.56 special operator

One of a-special-form, call-next-handler, call-next-method, dynamic, dynamic-let, dynamic-setq, if, letfuns, lambda, let/cc, next-method?, progn, quote, setq, unwind-protect, or with-handler.

8.57 specialize

A verbal form used to describe the creation of a more specific version of some entity. Normally applied to classes, slots and methods.

8.58 specialize on

A verbal form used to describe relationship of methods and the classes specified in their domains.

8.59 subclass

The behaviour and structure defined by a class class1 are inherited by a set of classes which are termed subclasses of class1. A subclass can be either direct or indirect or itself.

8.60 superclass

A class1 is a superclass of class2 iff class2 is a subclass of class1. A superclass can be either direct or indirect or itself.

8.61 top dynamic

Top dynamic bindings are created by defglobal, referenced by dynamic and modified by dynamic-setq. There is only one top dynamic environment.

8.62 top lexical

Top lexical bindings are created in the top lexical environment of a module by a defining form. All these bindings are immutable except those created by deflocal which creates a mutable top-lexical binding. All such bindings are referenced by variables and those made by deflocal are modified by setq. Each module defines its own distinct top lexical environment.