The basic ideas of agents (added to the basic object-oriented framework of Eiffel in 1997; see also C# “delegates”) can be expressed in words familiar in the functional programming literature: we treat operations (functions in functional programming, features in object-oriented programming) as “first-class citizens.” In the OO context, the only first-class citizens are, at runtime, objects, corresponding in the static structure to classes.
An agent is an object representing a feature of a certain
class, ready to be called. A feature call
...) is entirely defined by the feature name
f, the target object denoted by
x, and the arguments
an agent expression specifies
f, and may specify
none, some, or all of the target and arguments, said to be
closed. Any others, not provided in the agent’s
definition, are open. The expression denotes an
object; the object represents the feature with the closed arguments
set to the given values. One of the operations that can be performed
on the agent object is
call, representing a call
f; if the agent has any open arguments, the
corresponding values must be passed as arguments to
call (for the closed arguments, the values used
are those specified in the agent’s definition).
The simplest example of agent expression is
. Here all the
arguments are open, but the target is closed. So if
a is this agent expression—as a result of the
a := , or of a call ...