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

Implementing Iterator Class in Eiffel

I'm given this test class from the teacher and I have an issue understanding how to implement my class to create itself in this order. code: t5: BOOLEAN local bag: MY_BAG[STRING] bag3: like bag2 bag4: MY_BAG[STRING] …
geforce
  • 61
  • 6
0
votes
1 answer

storing two classes in a data stucture at once in EIFFEL

I am making a clinic and I need to make a object that stores two medicines at once. The interaction object means MEDICATION_1 is interacting with MEDICATION_2 However the following code is not correct because it does not meet the generic parameter…
geforce
  • 61
  • 6
0
votes
1 answer

Finding a object in a HASH_TABLE using item feature on EIFFEL

I am having a problem comparing two objects in a HASH_TABLE PERSON is a class with attributes such as name, b-day, status of relationship, spouse name, spouse id. So basically composed of attributes code: list: HASH_TABLE[PERSON,…
geforce
  • 61
  • 6
0
votes
1 answer

Eiffel loop test program

im learning the eiffel language and trying to do some basic stuff,as this: class APPLICATION inherit ARGUMENTS create make feature make local testvar:INTEGER i:INTEGER do from i := 0 until i >=…
0
votes
1 answer

Eiffel test program error

im trying to learn Eiffel language,and im just trying to make a very basic program that would display a given number.However,I keep getting an error without any explanation: note description : " application root class" date :…
0
votes
2 answers

Check Assertion Violation in Eiffel using Array_List

CUSTOMER class class CUSTOMER create make feature{NONE} -- Creation make(a_name:STRING) -- Create a customer with an `account' local l_account: ACCOUNT l_name: IMMUTABLE_STRING_8 l_bank: BANK do …
geforce
  • 61
  • 6
0
votes
2 answers

Ensure clause in Eiffel regarding across syntax

find(c: CHARACTER; position: INTEGER): INTEGER This feature finds a character by starting at position i and searching. Once it finds the index it outputs it. However if no such character exists in the word then 0 is output Question: The…
geforce
  • 61
  • 6
0
votes
2 answers

Eiffel algorithm: First Repeated Character

I'm programming in Eiffel for a school Lab, and one of the tasks is to find a bug in a given algorithm. The algorithm returns the first repeated character. The algorithm works as follows: word: STRING first_repeated_character: CHARACTER local i:…
M. Averbach
  • 121
  • 10
0
votes
1 answer

How can I make words in even position uppercase?

Here is my eiffel program, which is basically doing space removal (remove the redundant spaces in a given text file) to follow the regular expresson: A+(SA+)*EOL, where for each line in the file, it must start with alphabets and only one spaces…
Rob Ye
  • 63
  • 1
  • 7
0
votes
1 answer

How do I get rid of the last space when coding space removal

Here is the my Eiffel Code for my space removal assignment: feature {NONE} -- Main routine copy_file -- Copy a file character by character from input to output require input_open: input.is_readable output_open: output.is_writable local flag:…
Rob Ye
  • 63
  • 1
  • 7
0
votes
2 answers

Replication from multiple inheritance in Eiffel

I am struggling to understand the interplay of multiple inheritance with replication and polymorphism. Please consider the following classes forming a classical diamond pattern. deferred class A feature a deferred end end deferred class…
beckni
  • 3
  • 3
0
votes
1 answer

Visitor pattern and composite pattern

Im trying to develop a way to construct an arithmetic and logical expressions, and perform operations on them. For the structure I am using the composite pattern, and for the operations I am using the visitor pattern. I am a little confused on the…
Deniz Cetinalp
  • 901
  • 1
  • 18
  • 34
0
votes
1 answer

Command line compilation of Hello World in Eiffel (Unknown root class error)

I'm trying to build a hello world program in Eiffel, and this is how I tried. I use Mac OS X 10.10. I installed the Eiffel programming language with brew install eiffelstudio. Everything works fine without an issue. I have all the tools in…
prosseek
  • 182,215
  • 215
  • 566
  • 871
0
votes
2 answers

What would be the disadvantages of building a website purely in Eiffel using EWF (Eiffel Web Framework)?

We are looking to build a website on top of an existing Eiffel business-tier core, which is sitting over a MS SQL Server database. I am presently considering the advantages and disadvantages of writing the web and mobile tiers either purely in…
Liberty Lover
  • 844
  • 10
  • 12
0
votes
2 answers

Proving an algorithm correct by induction

I am supposed to prove an algorithm by induction and that it returns 3n - 2n for all n >= 0. This is the algorithm written in Eiffel. P(n:INTEGER):INTEGER; do if n <= 1 then Result := n else Result := 5*P(n-1) - 6*P(n-2) …
user3325783