Questions tagged [eiffel]

Eiffel is a statically typed object-oriented programming language closely related with the programming method of the same name. Both are based on a set of principles like Design by Contract, Command-Query Separation, Uniform Access, etc. Many concepts initially introduced by Eiffel find their way to C#, Java and other languages. The program in Eiffel can be compiled unchanged for almost any target platform.

Background

The design goal behind the Eiffel language, libraries, and programming methods is to enable programmers to create reliable, reusable software modules. Eiffel supports multiple inheritance, genericity, polymorphism, encapsulation, type-safe conversions, and parameter covariance. Eiffel's most important contribution to software engineering is design by contract (DbC), in which assertions, preconditions, postconditions, and class invariants are employed to help ensure program correctness without sacrificing efficiency.

Eiffel's design is based on object-oriented programming theory, with only minor influence of other paradigms or concern for support of legacy code. Eiffel formally supports abstract data types. Under Eiffel's design, a software text should be able to reproduce its design documentation from the text itself, using a formalized implementation of the "Abstract Data Type". See wikipedia for more information.

Standards

The Eiffel language definition is an international standard ISO/IEC DIS 25436. The latter is identical to the version of ECMA International: Standard ECMA-367, Eiffel: Analysis, Design and Programming Language.

Key characteristics

  • An object-oriented program structure in which a class serves as the basic unit of decomposition.
  • Design by contract tightly integrated with other language constructs.
  • Automatic memory management, typically implemented by garbage collection.
  • Inheritance, including multiple inheritance, renaming, redefinition, "select", non-conforming inheritance, and other mechanisms intended to make inheritance safe.
  • Constrained and unconstrained generic programming.
  • A uniform type system handling both value and reference semantics in which all types, including basic types such as INTEGER, are class-based.
  • Static typing.
  • Void safety, or static protection against calls on null references, through the attached-types mechanism.
  • Agents, or objects that wrap computations, closely connected with closures and lambda calculus.
  • Once routines, or routines evaluated only once, for object sharing and decentralized initialization.
  • Keyword-based syntax similar to ALGOL/Pascal but separator-free, insofar as semicolons are optional, with operator syntax available for routines.
  • Case insensitivity.
  • Built-in support for concurrency using SCOOP (Simple Concurrent Object-Oriented Programming) model.

Resources

288 questions
0
votes
1 answer

How to extend STRING class properly in Eiffel

I've just got the ACCOUNT old sample and write some code with the STRING owner's type: class ACCOUNT create make feature balance: INTEGER owner: STRING make do create owner.make_empty end minimum_balance: INTEGER = 1000 open (who:…
SeregASM
  • 75
  • 12
0
votes
1 answer

Scoop with agents

I'm trying to use an agent callback concurrently. Unfortunately, no matter what I do it always seems to run sequentially instead of parallel. (without the agent it doesn't) main class(APPLICATION): class APPLICATION inherit …
algorithms
  • 1,085
  • 1
  • 12
  • 21
0
votes
2 answers

In Eiffel, what is the difference between entities, variables, fields and arguments?

I've seen the terms entity, variable, and argument used to describe things about Eiffel, that look quite similar to me, and I wanted to understand what is the intention behind using either term instead of the other. Arguments — Some routines require…
g4v3
  • 133
  • 2
  • 10
0
votes
1 answer

Eiffel: Do expanded types conform to ANY?

Assume that foo: ANY is an assignable entity. What happens when I do foo := create {BOOLEAN}? It would fail always, because BOOLEAN (an expanded type) does not conform to ANY (a reference type), correct?
g4v3
  • 133
  • 2
  • 10
0
votes
1 answer

How to update scons build, when source file changes

I do not get the automated build to update the project with SCons. First I change something in the source files and the scons tells me: scons: done reading SConscript files. scons: Building targets ... scons: `.' is up to date. scons: done building…
Leder
  • 396
  • 1
  • 5
  • 21
0
votes
1 answer

Error in Eiffel implementation of Burnikel and Ziegler algorithm 2

I need another set of eyes to tell me what is wrong with my Eiffel implementation of Burnikel and Ziegler's division, specifically "Algorithm 2 - 3n/2n". The Eiffel feature is shown below. The type "like Current" is an ARRAYED_LIST [NATURAL_8]. …
jjj
  • 23
  • 8
0
votes
1 answer

Error with If Statment in Liberty/ISE Eiffel

I have a problem with the if statment. I have a program with commandline-arguments and utf8 (€ - Symbol). The error is in works_not in the if statement. class EURO insert ARGUMENTS create {ANY} make feature {ANY} make do …
0
votes
1 answer

How to extend a feature's require conditions in Eiffel?

I have a class, which redefines the copy feature from ANY. I would like to add a new require condition, but I get this error: Assertion in redeclaration uses just 'require' or 'ensure'. invalid precondition feature 'copy' Code: copy ( other : like…
Iter Ator
  • 8,226
  • 20
  • 73
  • 164
0
votes
2 answers

Eiffel: Covariant illegal types passed as arguments?

(emphasis mine) Covariant redefinition of fields and functions provides no problems, but covariant redefinition of arguments does create a problem that illegal types can be passed as arguments. But, if redefining field and function types…
g4v3
  • 133
  • 2
  • 10
0
votes
1 answer

How to initialize an array in Eiffel

How to initialize an array with a list of numbers in Eiffel? In C it would be like this: int foo[] = {2, 3, 5, 7, 10, 87, 72, 67, 1, 0};
David Zaragoza
  • 119
  • 1
  • 6
0
votes
2 answers

Eiffel: Can I use `expanded SOME_DEFERRED_CLASS`?

x: expanded SOME_DEFERRED_CLASS is impossible because: A deferred class cannot be used for object instantiation. An expanded type does not allow polymorphism. Have I missed something, or am I right?
g4v3
  • 133
  • 2
  • 10
0
votes
2 answers

Accessing Parents attributes

It might be a silly question, but i'm new to C#. I am wondering if there is a way to use directly parent's attributes in child class. I did a lot of Eiffel and when a class is inherited by one or more classes(cause yes Eiffel don't have interfaces…
user5991189
0
votes
1 answer

Eiffel: Expanded classes with no fields are `=` or not?

In Eiffel, if comparing objects of an expanded type, the = operator compares them field by field, checking if the content of each field is identical in both objects. Let's imagine two expanded classes with no features defined in them: expanded class…
g4v3
  • 133
  • 2
  • 10
0
votes
1 answer

Invariant sharing with Eiffel's keyword `like`

In Eiffel, it is possible to specify a type with an 'anchored declaration'. I wonder if the relevant invariants in the class also apply to an anchored declaration: class C feature f: INTEGER do ... Do something ... …
g4v3
  • 133
  • 2
  • 10
0
votes
1 answer

What is the domain of trigonometric functions in Eiffel? Is it [-pi/4,+pi/4]?

In Eiffel, the class DOUBLE_MATH defines trigonometric functions. When I see the interface of this class as shown here, it says cosine (v: REAL_64): REAL_64 -- Trigonometric cosine of radian `v' approximated -- in the…
GoodDeeds
  • 7,956
  • 5
  • 34
  • 61