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
13
votes
8 answers

Is there an beautiful way to assert pre-conditions in Java methods?

A lot of my functions have a whole load of validation code just below the declarations: if ( ! (start < end) ) { throw new IllegalStateException( "Start must be before end." ); } I'd like to precisly specify the valid ranges of certain…
Salim Fadhley
  • 22,020
  • 23
  • 75
  • 102
11
votes
2 answers

How does .NET 4.0's design by contract compare to Eiffel?

I had the "pleasure" to be taught Eiffel at college by none other than Bertrand Meyer himself and just read that .NET 4.0 will include design by contract. Can anyone with some insight elaborate on how powerful this will be compared to Eiffel's…
kitsune
  • 11,516
  • 13
  • 57
  • 78
9
votes
6 answers

Object-Oriented Callbacks for C++?

Is there some library that allows me to easily and conveniently create Object-Oriented callbacks in c++? the language Eiffel for example has the concept of "agents" which more or less work like this: class Foo{ public: Bar* bar; Foo(){ …
Mat
  • 91
  • 1
  • 1
  • 3
7
votes
3 answers

How does Racket Scheme's "design by contract" features different from Eiffel?

I know that both Eiffel (the progenitor) and Racket both to implement "Design by Contract" features. Sadly, I am not sure how one would different from the other. Eiffel's DBC is reliant on the OOP paradigm and inheritance, but how would Racket, a…
Eli Schneider
  • 4,903
  • 3
  • 28
  • 50
5
votes
3 answers

Experiences in learning Eiffel

Does anyone have any experiences in learning the language Eiffel. Is the Eiffel Studio like Visual Studio? Is it a good route to take to learn OOP? etc.
Chris_45
  • 8,769
  • 16
  • 62
  • 73
5
votes
1 answer

Immutable class in Eiffel

I'm trying to make an immutable POINT class in Eiffel. Is the code below defines one? The {NONE} accessibility for the x and y fields is enough for it? Can I write something to the class invariant like x = x', or how else can I achieve…
Ferenc Dajka
  • 1,052
  • 3
  • 17
  • 45
4
votes
1 answer

Eiffel "create" over C++ constructor?

What is the difference between C++'s constructor and Eiffels create procedure declaration? What value is there in being able to have multiple constructor functions for a class? Or is there any other benefit to Eiffels "create"? Thankyou
Michael Brown
  • 498
  • 4
  • 13
4
votes
3 answers

How to initialize a local variable in its declaration in Eiffel?

I tried to do this: local condition: BOOLEAN condition := true do And something like this: local condition: BOOLEAN := true do Obviously neither work, but I need to initialize a variable inside the declaration because I don't want the…
Rama
  • 4,697
  • 5
  • 22
  • 19
4
votes
1 answer

Eiffel: loosening the pre-conditions and tightening the post-conditions?

In Eiffel it is said that we should "loosen the pre-conditions and tightening the post-conditions", but I am not sure what this means. How does this benefit/is benefited by sub-classing? Thank you
Eli Schneider
  • 4,903
  • 3
  • 28
  • 50
4
votes
1 answer

Number of available processors using Eiffel

I'm toying with Eiffels SCOOP. In my program a bunch of worker run in parallel. I want to create as many worker as processor are available for me. Is there and "easy" way in Eiffel to find the number of available processors?
Birliban
  • 65
  • 4
3
votes
7 answers

Various questions regarding pure OO (Getting set up WITHOUT an ide; Tutorials; The associated books)

I've been wanting to get into a pure-OO language for a while now, but I'm put off by the fact that they all seem to demand an IDE and I can't find any good tutorials that aren't in video format. I'm happy to use an IDE later, but I don't want to…
TheIronKnuckle
  • 7,224
  • 4
  • 33
  • 56
3
votes
3 answers

Result attached or exception

Let's say that I have a function f which should return an attached T by calling g. However, g returns a detachable T. If g results in a Void, I want to raise an exception like this: f: T do if attached g as res then Result := res …
Ilgiz Mustafin
  • 414
  • 1
  • 4
  • 15
3
votes
1 answer

What's the point of the local variable in Eiffel's attached-statement?

In Eiffel, Void Safety is a way to statically prevent dereferencing uninitialised ("null") objects. The way it works is that first, the object has to be declared as detachable, and then you need to check in an if-block whether the object is actually…
Stazzney
  • 33
  • 2
3
votes
1 answer

Eiffel C Compiler Error

I am using the Effiel studio to code and I noticed at the ErrorList down the menu, there is an error message showing : "Error code: C Compiler Error Error: External C/C++ compilation failed. What to do: Check the external C/C++ compilation for…
JS2014
  • 31
  • 3
3
votes
2 answers

Examples of error handling in Eiffel

I can't find any substantial example of error handling in Eiffel. I have only found examples that either are trivial, or they completely ignore errors, or they leave error handling to the reader. I am interested in knowing how errors can travel…
Eleno
  • 2,864
  • 3
  • 33
  • 39
1
2 3
19 20