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
1
vote
2 answers

multiple inheritance in Eiffel

Hoi,The multiple inheritance in eiffel really confused me ,can anybody tell me what class French_Us_Driver inherit from all its parent-class. class Driver feature(ANY) violation end end --end Driver class French_Driver …
echo
  • 11
  • 1
1
vote
1 answer

LINKED_LIST indexing from 0, not 1, possible?

In eiffel, indexing usually starts from 1, not 0. I have following 2 attributes: arr: ARRAY[A] link: LINKED_LIST[B] For array, I can make its indexing starts from 0 purposely, like following: arr.force (value, arr.count) so that arr[0] will be…
Miku
  • 41
  • 1
  • 5
1
vote
1 answer

How to generate a random Integer between two values in Eiffel?

I want to simulate dice roll functionality. However, I don't get what I expect. I want to get a Dice with value ranging from 1 to 6 inclusively (dice). I tried to find it in Eiffel Documentation, but it is very hard to do.
Dragos Strugar
  • 1,314
  • 3
  • 12
  • 30
1
vote
1 answer

How to travse a linked list in my postcodition use across loop in Eiffel?

I try to use across 1|..|list.count as j all list.i_th(z) ~ old list.i_th(z) end but it says unknown identifier z. Whats wrong with this syntax??
buzzmind
  • 109
  • 2
  • 10
1
vote
2 answers

Why I got valid_index precondition violation in Eiffel?

I just simply test a push_at feature of container class(made by array, basically). I dont know which part of my code triggers this violation. push_at (i: INTEGER; s: STRING) require valid_index: i >= 1 do container [i] :=…
buzzmind
  • 109
  • 2
  • 10
1
vote
2 answers

Effective Eiffel Postcondition for Ensuring that Array is sorted

I have implemented a query that tells if array is sorted or not. I want to make a good postcondition that will effectively check if array is sorted using across or something else. I tried to do this like this: is_sorted (a: ARRAY [INTEGER]):…
Dragos Strugar
  • 1,314
  • 3
  • 12
  • 30
1
vote
1 answer

How to get inverse trigonometric functions in Eiffel?

How do I use inverse trigonometric functions such as sin inverse, cos inverse, and tan inverse in Eiffel? I tried atan, arctan, and arctangent, but none of them work. I was also unable to find it in any other source. Thank you.
GoodDeeds
  • 7,956
  • 5
  • 34
  • 61
1
vote
1 answer

Unable to resolve error "target of assigner call has no associated assigner command" in Eiffel

In Eiffel Studio, I have been trying to access the fields of an object of a class I have defined from another class. However, it keeps giving errors that I am not able to understand and solve. The following is a snippet of example code: Class where…
GoodDeeds
  • 7,956
  • 5
  • 34
  • 61
1
vote
1 answer

Getting the error “VEVI: Variable is not properly set” in Eiffel, too

I am trying to make an agent "print_min_fold" for for a linked_list "folds" in Eiffel: ------------------------Schnipp: class PF_HP create make feature --Queries: -- n : NONE; grid: separate GRID; seq: BOOL_STRING; strseq: STRING; iseq:…
Leder
  • 396
  • 1
  • 5
  • 21
1
vote
1 answer

Read key in Eiffel console application

Is there anything like Console.ReadKey from .NET in Eiffel on Windows? I need a way to read input from the console without waiting for the user to press Enter. The function io.read_character cannot be used because it blocks until the user presses…
Cepheus
  • 579
  • 4
  • 14
1
vote
1 answer

Function Composition Using Eiffel Agents

I am trying to do function composition in the Eiffel programming language. By function composition, I mean create a function that takes two functions f(x), g(x) and returns a function f(g(x)). The problem is that inline agents do not have access to…
1
vote
1 answer

Developer exception starting a client-server model on Eiffel net

I'm trying to establish a connection using sockets between 2 PC's on the same LAN using the Eiffel Programming Language. I'm trying to run the examples that are by default on the installation directory of Eiffel Studio. However right now I'm trying…
1
vote
1 answer

Interface of read_character and last_character in STD_FILES

According to a std_files.e that I have found, read_character requires not end_of_file, but it doesn't specify any post-condition; and last_character has no preconditions. Therefore, what happens if you call last_character before calling…
Eleno
  • 2,864
  • 3
  • 33
  • 39
1
vote
1 answer

Comparing object/value instead of reference in Eiffel

I have been trying to figure out how to make the postcondition work for the following code. There are 3 classes, Bank is the client of Customer, and Customer is the client of Account Here is the Bank Class, I just cant pass the postcondition…
swordgit
  • 115
  • 10
1
vote
2 answers

Creating dynamic objects (Eiffel)

I have to find a way to create objects dynamically, that means the user can decide how many objects to create once the program starts. What I tried to do is: if count = 6 then create player1.player …
DevX10
  • 483
  • 2
  • 6
  • 16