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 do I enforce assertions for Eiffel through command line?

Eiffel has a feature Design by Contract. According to this, for any routine, there is a check that assertions such as require and ensure must be true. However, I haven't been able to find out how to enforce the rule through command line that if the…
GoodDeeds
  • 7,956
  • 5
  • 34
  • 61
0
votes
1 answer

Setting precision for real types in Eiffel

In Eiffel, after doing some operations on a value of type DOUBLE, I get the result 1.9999999999999998, while the expected result is supposed to be 2. I know that this is caused due to inaccuracies in floating point arithmetic. I need only two digits…
GoodDeeds
  • 7,956
  • 5
  • 34
  • 61
0
votes
1 answer

make.exe": *** [pf_hp.res] Error 1 in Eiffel C-compilation w/ mingw

I once had a .res Error and I solved it by deleting the .res file. But now I cannot see a pf_hp.res file in sources directory or EIFGENs :-( I already installed estudio to a path without whitespace, to no avail. What can I do to get C-compilation…
Leder
  • 396
  • 1
  • 5
  • 21
0
votes
1 answer

What is the size of an integer in Eiffel? How does it handle overflow?

In Eiffel, what is the size of an INTEGER type? I was not able to find it, except here, where it is claimed that the size is 32 bits. In this case, how does Eiffel handle overflow? Is it undefined behavior like in C? Or is there a mechanism to…
GoodDeeds
  • 7,956
  • 5
  • 34
  • 61
0
votes
1 answer

How to use Sine, Cosine, Tan and Sqrt in Eiffel?

Coders out there - I suspect that's not more than 10 people worldwide:) - , I have a very, very simple question: How can I compute sin, cos, tan or sqrt with a REAL? a: REAL b: REAL ... b := a.power(2) works, but ... a: REAL b: REAL ... b :=…
Paulquappe
  • 15
  • 3
0
votes
1 answer

Eiffel is_equal() function

I'm trying to understand better the function is_equal() defined in class COMPARABLE. I would like to know in which case, for an object o the function call o.is_equal(o) gives false. I know that this function, differently from =, not just compares…
DevX10
  • 483
  • 2
  • 6
  • 16
0
votes
1 answer

Getting the error "VEVI: Variable is not properly set" in Eiffel

I am trying to make an iterator for for a linked_list in Eiffel. I am getting this error: Variable is not set properly. Class: ITERATOR_ON_COLLECTION [E] Feature: make Attribute(s): {ITERATOR}.target Line: 30 I know it's because of void safety but…
0
votes
1 answer

Eiffel - How do I make my classes readable?

I'm new to Eiffel and I'm trying to use the LINKED_LIST class for organizing instances of other class "MONOMIO" I've made. I added a function for ordering this elements and I use the remove and the cursor movement features and when I try to execute…
GiaccomoU
  • 9
  • 2
0
votes
1 answer

Eiffel - How can I initialize a LINKED_LIST?

I'm new to Eiffel and I'm trying to create an instance of Linked_List. I'm not really sure of how to do this with this class because I receive an syntax error whenever I try to do it that way. This is what I have: class APPLICATION inherit …
GiaccomoU
  • 9
  • 2
0
votes
2 answers

Eiffel Contracts doubts

I am working on a planning software being coded in Eiffel language, I've created the following code but I am not quite sure of which kind of post conditions and/or pre conditions should be specified for this class' routines. If you can provide…
0
votes
1 answer

Eiffel - Don't know why I have syntax error

I'm new to Eiffel and I'm trying to create a simple class called "Monomio", I have 3 features that are attributes and a feature that's a function. The problem is that I'm getting a syntax error, I compared it to other classes I found but can't find…
GiaccomoU
  • 9
  • 2
0
votes
0 answers

Incompatible library version running EiffelStudio

I installed EiffelStudio like this: 1) Downloaded Eiffel_15.12_gpl_98497-macosx-x86-64.tar.bz2 from official page. 2) cd /usr/local tar xvfj /path/Eiffel_15.12.tar.bz2 3) export ISE_EIFFEL=/usr/local/Eiffel_15.12 export…
Agustin Luques
  • 57
  • 1
  • 10
0
votes
1 answer

Post-Condition Violation with Feature in Eiffel

This is part of the class. This class is called BAG[G -> {HASHABLE, COMPARABLE}] it inherits from ADT_BAG which has deferred features such as count, extend, remove, remove_all, add_all... more, and domain to be re-implemented. domain returns…
geforce
  • 61
  • 6
0
votes
1 answer

Translating Eiffel loops to languages that do not support loop invariants/variants

A loop in Eiffel follows this format: from Init invariant Invariant until Exit variant Variant loop Body end How would you translate the above Eiffel pseudo-code to a language that does not support loop invariants/variants? …
Eleno
  • 2,864
  • 3
  • 33
  • 39
0
votes
1 answer

Odd "Check_VIOLATION" failed test case in Eiffel

The main issue from the below picture is that when "check Result end" statement is added it automatically fails and displays "CHECK_VIOLATION" error in debugger. Also, the HASH_TABLE doesn't store all items given to it but I fixed that by switching…
geforce
  • 61
  • 6