Difference between revisions of "Glossary"
(live type) |
m (s/LibertyEiffel/Liberty Eiffel/) |
||
(49 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
+ | '''Glossary of terms used in the Grand Book''' |
||
− | [[Category:Book]] |
||
+ | |||
+ | ''Notice:'' when a term has several different meanings, priority is given to the term's meaning in the context we are interested in, that of Eiffel computing and object-oriented programming of objects using design by contract. |
||
<div align="center"> |
<div align="center"> |
||
Line 18: | Line 20: | ||
'''attribute:''' an attribute of an object is part of the memorized |
'''attribute:''' an attribute of an object is part of the memorized |
||
information of that object. |
information of that object. |
||
− | In other words, using the attribute of some object does not |
+ | In other words, using the attribute of some object does not involve |
computation. |
computation. |
||
An attribute is either constant or variable. |
An attribute is either constant or variable. |
||
− | When not constant, attribute means |
+ | When not constant, attribute means exactly the same as |
− | [[#InstanceVariable|instance variable]] |
+ | [[#InstanceVariable|instance variable]]. |
</div> |
</div> |
||
<div id="AnchoredType"> |
<div id="AnchoredType"> |
||
− | '''anchored type:''' |
+ | '''anchored type:''' a type defined relative to another type. Anchored |
+ | types are those which use the keyword |
||
+ | [[Syntax diagrams#Type|<tt>like</tt>]]. |
||
</div> |
</div> |
||
Line 32: | Line 36: | ||
<div id="BackEnd"> |
<div id="BackEnd"> |
||
+ | '''back-end:''' the last part of a compiler which, after each class has been analyzed and no error has been detected, builds the executable that runs all the operations described in the source program. |
||
− | '''back-end:''' bla bla bla ... |
||
+ | |||
+ | Liberty Eiffel provides two back-ends: a [[compile_to_c|C back-end]] and in the near future possibly a [[compile_to_jvm|Java back-end]]. |
||
</div> |
</div> |
||
Line 38: | Line 44: | ||
<div id="Contravariance"> |
<div id="Contravariance"> |
||
− | '''contravariance:''' |
+ | '''contravariance:''' as opposed to [[#Covariance|covariance]]; we say that a language applies the contravariance rule |
+ | if, when a [[#Method|method]] is redefined, the argument types or the result type can be replaced by a more general type. |
||
+ | Eiffel does not apply the contravariance rule. Eiffel applies the [[#Covariance|covariance]] rule. |
||
</div> |
</div> |
||
<div id="Compiler"> |
<div id="Compiler"> |
||
+ | '''compiler:''' a program that can verify and then translate another program written in a computing [[#Language|language]]. |
||
− | '''compiler:''' bla bla bla... |
||
+ | Before doing the translation, the compiler checks that the program to be translated conforms to the syntax and rules of the [[#Language|language]]. |
||
</div> |
</div> |
||
<div id="Covariance"> |
<div id="Covariance"> |
||
+ | '''covariance:''' as opposed to [[#Contravariance|contravariance]]; we say that a [[#Language|language]] applies the covariance rule if, when an inherited [[#Method|method]] is redefined, the argument types or the result type can be replaced by a more specific type. |
||
− | '''covariance:''' bla bla bla ... |
||
+ | For example, if the class <TT>APPLE</TT> inherits from <TT>FRUIT</TT>, the arguments (or the result) of the redefined methods can pass from <TT>FRUIT</TT> to <TT>APPLE</TT>. |
||
+ | This type change is valid according to the covariance rule. |
||
+ | So the scope for redefinition varies in the same direction as the inheritance relationship, hence the name '''co'''variance. |
||
+ | Eiffel applies the covariance rule because that rule corresponds to the most useful way of using inheritance. |
||
</div> |
</div> |
||
== D == |
== D == |
||
+ | |||
+ | <div id="DesignPattern"> |
||
+ | '''design pattern''': Solution or computing framework for a known problem. |
||
+ | The ''Gang of Four'''s catalogue of design patterns [[Bibliography#GoF 1995|[GoF 1995]]] contains their version for Eiffel [[Bibliography#JMT 1999|[JMT 1999]]]. |
||
+ | See also the classes |
||
+ | [[library_class:ITERATOR|<tt>ITERATOR</tt>]] and |
||
+ | [[library_class:VISITOR|<tt>VISITOR</tt>]]. |
||
+ | </div> |
||
<div id="DynamicDispatch"> |
<div id="DynamicDispatch"> |
||
+ | '''dynamic dispatch:''' runtime selection of the [[#Method|method]] best adapted to the [[#DynamicType|dynamic type]] of the object to which the operation is applied. Dynamic dispatch is an essential feature of object-oriented programming. For more details, refer to the [[Dynamic dispatch|detailed description of dynamic dispatch]]. |
||
− | '''dynamic dispatch:''' bla bla bla ... |
||
</div> |
</div> |
||
<div id="DynamicType"> |
<div id="DynamicType"> |
||
+ | '''dynamic type:''' at runtime, the exact type of the object designated by an expression or by a variable. See also [[#StaticType|static type]]. |
||
− | '''dynamic type:''' bla bla bla ... |
||
+ | |||
</div> |
</div> |
||
Line 62: | Line 84: | ||
<div id="Expression"> |
<div id="Expression"> |
||
− | '''expression:''' |
+ | '''expression:''' as opposed to [[#Instruction|instruction]], an expression produces a return value. |
+ | For example, an expression can be used on the right-hand side of an assignment. |
||
+ | The constant <tt>True</tt> is an expression. |
||
+ | The constant <tt>5</tt> is also an expression. |
||
+ | The calculation <tt>i+1</tt> is one too. |
||
+ | Without being too dogmatic about it, good programming habits lead us not to allow [[#SideEffect|side effects]] during the evaluation of expressions. |
||
+ | See also the [[Syntax diagrams#Expression|syntax diagram for an expression]]. |
||
</div> |
</div> |
||
Line 71: | Line 99: | ||
[[#Attribute|attribute]], |
[[#Attribute|attribute]], |
||
a [[#Function|function]] or |
a [[#Function|function]] or |
||
− | a [[#Procedure|procedure]] |
+ | a [[#Procedure|procedure]]. |
Hence, feature also includes [[#Method|method]]. |
Hence, feature also includes [[#Method|method]]. |
||
</div> |
</div> |
||
<div id="Function"> |
<div id="Function"> |
||
+ | '''function:''' a function is a set of instructions that performs a certain task. With the exception of [[Current]], a function takes zero or several parameters and always returns a result. A function in computer science (and so in Eiffel) distinguishes itself from the mathematical function mainly by the fact that as well as calculating a result from its parameters, the Eiffel function can also have [[#SideEffect|side effects]]. |
||
− | '''function:''' bla bla bla ... |
||
+ | See also [[#Procedure|procedure]]. |
||
+ | |||
</div> |
</div> |
||
Line 82: | Line 112: | ||
== H == |
== H == |
||
+ | |||
+ | <div id="Heap"> |
||
+ | '''heap''': area in the memory where objects are stored. |
||
+ | </div> |
||
== I == |
== I == |
||
+ | |||
+ | <div id="Instance"> |
||
+ | '''instance''': synonym of object. An object or an instance of some class. |
||
+ | </div> |
||
<div id="InstanceVariable"> |
<div id="InstanceVariable"> |
||
'''instance variable:''' one memory field of some object. |
'''instance variable:''' one memory field of some object. |
||
− | As indicated, this memory field can be accessed for |
+ | As indicated, this memory field can be accessed either for reading or for writing. |
− | + | The preferred Eiffel terminology is ''writable'' [[#Attribute|''attribute'']]. |
|
</div> |
</div> |
||
<div id="Instruction"> |
<div id="Instruction"> |
||
+ | '''instruction:''' in contrast to an [[#Expression|expression]], an instruction does not produce a return value. |
||
− | '''instruction:''' bla bla bla ... |
||
+ | In order to do anything useful, an instruction has to produce a lasting [[#SideEffect|side effect]]. |
||
+ | See also the [[Syntax diagrams#Instruction|syntax diagram for an instruction]]. |
||
</div> |
</div> |
||
Line 102: | Line 142: | ||
<div id="Language"> |
<div id="Language"> |
||
+ | '''language''': a computer language and a language used for interacting with or between computers. |
||
− | '''language:''' bla bla bla... |
||
+ | A programming language is a computer language. |
||
+ | ''[Did I misunderstand the French? This doesn't seem to say anything useful.]'' |
||
+ | Eiffel is a programming language. |
||
+ | One should not confuse ''language'' with a [[#Compiler|compiler]] for that language. |
||
+ | </div> |
||
+ | |||
+ | <div id="LateBinding"> |
||
+ | '''late binding''': see [[#DynamicDispatch|dynamic dispatch]]. |
||
</div> |
</div> |
||
<div id="Library"> |
<div id="Library"> |
||
+ | '''library''': a software library is a collection of classes intended to facilitate a particular task |
||
− | '''library:''' bla bla bla... |
||
+ | or to provide objects of general usefulness. The library provided with Liberty Eiffel is very extensive |
||
+ | and supplies all the usual primitive objects (INTEGER, CHARACTER, STRING, REAL, etc.), all the usual data structures |
||
+ | (COLLECTION, SET, DICTIONARY, QUEUE, STACK, etc.) along with many other classes. |
||
</div> |
</div> |
||
<div id="LiveType"> |
<div id="LiveType"> |
||
− | '''live type |
+ | '''live type''': this phrase is used throughout the Liberty Eiffel documentation |
+ | to refer to a type that is actually used |
||
+ | in the program and which has C code generated for it. The phrase is a literal translation from |
||
+ | French; a better expression in English might be '''Instantiated type'''. |
||
+ | </div> |
||
+ | |||
+ | <div id="LocalVariable"> |
||
+ | '''local variable''': refers to a variable allocated on the stack during the execution of a routine. |
||
+ | In Eiffel, local variables, like other variables, are automatically initialised to default values. |
||
+ | See also the keyword '''local''' in the [[Syntax diagrams#Routine|routine definition of the syntax diagrams]]. |
||
</div> |
</div> |
||
Line 128: | Line 188: | ||
<div id="Procedure"> |
<div id="Procedure"> |
||
+ | '''procedure:''' a procedure is a set of instructions that performs a certain task. With the exception of [[Current]], which takes no parameters, a procedure takes zero or several parameters and returns no result. See also [[Glossary#function|function]]. |
||
− | '''procedure:''' bla bla bla ... |
||
</div> |
</div> |
||
Line 136: | Line 196: | ||
<div id="Routine"> |
<div id="Routine"> |
||
− | '''routine:''' routine is short-hand |
+ | '''routine:''' routine is short-hand for [[#Procedure|procedure]] or [[#Function|function]]. |
Hence routine is also the equivalent of [[#Method|method]]. |
Hence routine is also the equivalent of [[#Method|method]]. |
||
</div> |
</div> |
||
Line 143: | Line 203: | ||
<div id="SideEffect"> |
<div id="SideEffect"> |
||
− | '''side-effect:''' |
+ | '''side-effect:''' applies to a [[#Routine|routine]] which permanently modifies the |
+ | environment in which it is called. For example: changing objects visible to the calling environment, |
||
+ | writing to the screen, emitting a sound, or writing to a printer or a file. |
||
+ | </div> |
||
+ | |||
+ | <div id="Stack"> |
||
+ | '''stack''': a data structure used on a first in, first out (FIFO) basis. |
||
+ | In executing a program, a stack is used to store successive [[#Routine|routine]] calls while they |
||
+ | are current. In fact, the stack contains the memory addresses that allow the program to return to |
||
+ | the calling context at the end of each [[#Routine|routine's]] execution. |
||
+ | The stack is also used to allocate the memory associated with [[#LocalVariable|local variables]]. |
||
+ | Note that memory management in the stack is very efficient. In particular, the time taken to allocate space |
||
+ | for [[#LocalVariable|local variables]], even if there are many, is almost negligible. |
||
+ | (See also [[#Heap|the heap]]). |
||
</div> |
</div> |
||
<div id="StaticType"> |
<div id="StaticType"> |
||
− | '''static type:''' |
+ | '''static type:''' an [[#Expression|expression's]] declaration type. In contrast to |
+ | [[#DynamicType|dynamic type]], no runtime information is taken into account in determining |
||
+ | the static type of an object. |
||
+ | An expression's static type does not depend on the exact nature of the object designated by the expression. |
||
+ | The static type of [[Current|<tt>Current</tt>]] is that of the surrounding class. |
||
+ | See also [[#DynamicType|dynamic type]]. |
||
</div> |
</div> |
||
== T == |
== T == |
||
− | |||
− | <div id="TypePrediction"> |
||
− | '''type prediction:''' bla bla bla ... |
||
− | </div> |
||
== U == |
== U == |
Latest revision as of 21:33, 14 June 2016
Glossary of terms used in the Grand Book
Notice: when a term has several different meanings, priority is given to the term's meaning in the context we are interested in, that of Eiffel computing and object-oriented programming of objects using design by contract.
A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z
A
attribute: an attribute of an object is part of the memorized information of that object. In other words, using the attribute of some object does not involve computation. An attribute is either constant or variable. When not constant, attribute means exactly the same as instance variable.
anchored type: a type defined relative to another type. Anchored types are those which use the keyword like.
B
back-end: the last part of a compiler which, after each class has been analyzed and no error has been detected, builds the executable that runs all the operations described in the source program.
Liberty Eiffel provides two back-ends: a C back-end and in the near future possibly a Java back-end.
C
contravariance: as opposed to covariance; we say that a language applies the contravariance rule if, when a method is redefined, the argument types or the result type can be replaced by a more general type. Eiffel does not apply the contravariance rule. Eiffel applies the covariance rule.
compiler: a program that can verify and then translate another program written in a computing language. Before doing the translation, the compiler checks that the program to be translated conforms to the syntax and rules of the language.
covariance: as opposed to contravariance; we say that a language applies the covariance rule if, when an inherited method is redefined, the argument types or the result type can be replaced by a more specific type. For example, if the class APPLE inherits from FRUIT, the arguments (or the result) of the redefined methods can pass from FRUIT to APPLE. This type change is valid according to the covariance rule. So the scope for redefinition varies in the same direction as the inheritance relationship, hence the name covariance. Eiffel applies the covariance rule because that rule corresponds to the most useful way of using inheritance.
D
design pattern: Solution or computing framework for a known problem. The Gang of Four's catalogue of design patterns [GoF 1995] contains their version for Eiffel [JMT 1999]. See also the classes ITERATOR and VISITOR.
dynamic dispatch: runtime selection of the method best adapted to the dynamic type of the object to which the operation is applied. Dynamic dispatch is an essential feature of object-oriented programming. For more details, refer to the detailed description of dynamic dispatch.
dynamic type: at runtime, the exact type of the object designated by an expression or by a variable. See also static type.
E
expression: as opposed to instruction, an expression produces a return value. For example, an expression can be used on the right-hand side of an assignment. The constant True is an expression. The constant 5 is also an expression. The calculation i+1 is one too. Without being too dogmatic about it, good programming habits lead us not to allow side effects during the evaluation of expressions. See also the syntax diagram for an expression.
F
feature: feature is used to denote either an attribute, a function or a procedure. Hence, feature also includes method.
function: a function is a set of instructions that performs a certain task. With the exception of Current, a function takes zero or several parameters and always returns a result. A function in computer science (and so in Eiffel) distinguishes itself from the mathematical function mainly by the fact that as well as calculating a result from its parameters, the Eiffel function can also have side effects. See also procedure.
G
H
heap: area in the memory where objects are stored.
I
instance: synonym of object. An object or an instance of some class.
instance variable: one memory field of some object. As indicated, this memory field can be accessed either for reading or for writing. The preferred Eiffel terminology is writable attribute.
instruction: in contrast to an expression, an instruction does not produce a return value. In order to do anything useful, an instruction has to produce a lasting side effect. See also the syntax diagram for an instruction.
J
K
L
language: a computer language and a language used for interacting with or between computers. A programming language is a computer language. [Did I misunderstand the French? This doesn't seem to say anything useful.] Eiffel is a programming language. One should not confuse language with a compiler for that language.
late binding: see dynamic dispatch.
library: a software library is a collection of classes intended to facilitate a particular task or to provide objects of general usefulness. The library provided with Liberty Eiffel is very extensive and supplies all the usual primitive objects (INTEGER, CHARACTER, STRING, REAL, etc.), all the usual data structures (COLLECTION, SET, DICTIONARY, QUEUE, STACK, etc.) along with many other classes.
live type: this phrase is used throughout the Liberty Eiffel documentation to refer to a type that is actually used in the program and which has C code generated for it. The phrase is a literal translation from French; a better expression in English might be Instantiated type.
local variable: refers to a variable allocated on the stack during the execution of a routine. In Eiffel, local variables, like other variables, are automatically initialised to default values. See also the keyword local in the routine definition of the syntax diagrams.
M
method: is the equivalent of routine, that is to say, a method can be a function or a procedure as well.
N
O
P
procedure: a procedure is a set of instructions that performs a certain task. With the exception of Current, which takes no parameters, a procedure takes zero or several parameters and returns no result. See also function.
Q
R
routine: routine is short-hand for procedure or function. Hence routine is also the equivalent of method.
S
side-effect: applies to a routine which permanently modifies the environment in which it is called. For example: changing objects visible to the calling environment, writing to the screen, emitting a sound, or writing to a printer or a file.
stack: a data structure used on a first in, first out (FIFO) basis. In executing a program, a stack is used to store successive routine calls while they are current. In fact, the stack contains the memory addresses that allow the program to return to the calling context at the end of each routine's execution. The stack is also used to allocate the memory associated with local variables. Note that memory management in the stack is very efficient. In particular, the time taken to allocate space for local variables, even if there are many, is almost negligible. (See also the heap).
static type: an expression's declaration type. In contrast to dynamic type, no runtime information is taken into account in determining the static type of an object. An expression's static type does not depend on the exact nature of the object designated by the expression. The static type of Current is that of the surrounding class. See also dynamic type.