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

Implementation contraint: The class feature only_from_type uses an inline agent

Is there a semantic behind not being able to have an agent into a ensure class routine or is it a current compiler restriction? only_from_type (some_items: CHAIN[like Current]; a_type: detachable like {ENUMERATE}.measuring_point_type_generation):…
Pipo
  • 4,653
  • 38
  • 47
0
votes
1 answer

variable is not properly set after renaming into heir

I know how to fix it (see my solution @bottom) but don't understand why this compilation error occurs, as in my mind, renamed attributes should be created by the Precursor into default_create. Why isn't that so? NRJ_ENTITY inherit ANY …
Pipo
  • 4,653
  • 38
  • 47
0
votes
1 answer

How can I run a cursor tree in Eiffel?

I need a cursor tree and I found CURSOR_TREE and RECURSIVE_CURSOR_TREE classes in EiffelStudio but they are deferred and I don't know how to implement them. Isn'it strange?
B3nTek
  • 7
  • 6
0
votes
1 answer

How to declare an INTEGER_64 from number?

How to declare an INTEGER_64 from a declared number? ("3000000000").to_integer_64 is the only way I found
Pipo
  • 4,653
  • 38
  • 47
0
votes
1 answer

twin vs deep_twin, is_equal vs is_deep_equal

What is the difference between twin and deep_twin which implies (and ensures) the difference between is_equal and is_deep_equal in eiffel?
Pipo
  • 4,653
  • 38
  • 47
0
votes
2 answers

How to test objects of formal generic types for equality in Eiffel?

I should test for equality two generic attributes like a, b: G ... Result := a.is_equal (b) but VUTA (target rule validity) says "separate target of the Object_call is not controlled". What can I do?
B3nTek
  • 7
  • 6
0
votes
1 answer

Error handling in Eiffel and Rescue clause

Is writing one rescue clause at the end of a program to end the program in Eiffel enough to handle exceptions such as pre, postconditions or invariant violations in any of the routines written in the program? Or should I write rescue clause for…
Akash Tadwai
  • 100
  • 1
  • 9
0
votes
1 answer

How to Swap Value in Eiffel Programming Language?

I am defining like this in eiffel to swap the value. We cannot use the way we define in c++. swap(x,y):INTEGER do x;y := y;x end How to define functions in Eiffel? I want to define heap sort but it is showing some…
Yogesh
  • 1
  • 1
0
votes
1 answer

How to send an email with eiffel kernel library

How can a mail be sent in eiffel with kernel library? which class to use?
Pipo
  • 4,653
  • 38
  • 47
0
votes
1 answer

FIle handling in Eiffel

Given a file input.txt, which consists of a number of elements in arrays and elements in the arrays, I should read the data and copy it to arrays in Eiffel. For example, for 3 3 4 5 2 3 1 I should get len = 3, a1 = {3,4,5}, a2 = {2,3,1}. I have…
Akash Tadwai
  • 100
  • 1
  • 9
0
votes
1 answer

Some ways to sort a collection of comparables in eiffel

Which library of the kernel should I use to sort a collection in eiffel? where can I find an example of sort? are the tipical bubble sort, etc available? Any sorter with agent would be very useful too to avoid having to do it with a comparable…
Pipo
  • 4,653
  • 38
  • 47
0
votes
1 answer

Why is LINKED_SET unable to compare objects?

As I'd like to know if some object is into a LINKED_SET to prune it in my context, I'm unable to compare it as an object instead of its reference. changeable_comparison_criterion: BOOLEAN -- May `object_comparison' be changed? --…
Pipo
  • 4,653
  • 38
  • 47
0
votes
1 answer

How to specify when giving a generic parameter that it should implement some specific creation method?

How to specify when giving a generic parameter that it should implement some specific creation method? as LIST[G -> create make end] doesn't work :-( In my particular case, * SMA_INVERTER_MANAGER_CSV has inherited from…
Pipo
  • 4,653
  • 38
  • 47
0
votes
2 answers

how to merge an attribute in multi-inheritence

Repeatedly inheriting from 2 classes having the same parent, I fall into the classic case of inheriting 2 times of the same attribute. I'd like to merge the 2 attributes into one and tried to do it with an undefine, but it gets me a compile…
Pipo
  • 4,653
  • 38
  • 47
0
votes
2 answers

explicit creation type not conforming to type of target

I really don't understand as it seems to me the basics of type conformance. I have a Creation instruction lists explicit creation type which does not conform to type of target on create {JANITZA_DEVICE} l_device.make_from_file_path (a_file_path)…
Pipo
  • 4,653
  • 38
  • 47