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

initialize an array with loop in Eiffel

I'm trying so hard to initialize an array or arrayList of strings from a file while using a loop, but every function I'm using- put/enter/force nothing seems to work. the array time after time got filled with the last string I read even though I'm…
0
votes
1 answer

Proving the partial correctness of the program

Below is the function that finds max number in the array, so prof taught us to prove the partial correctness. He gave the solution proving the loop invariant is maintained. Can any body explain me the solution? find_max (a: ARRAY [INTEGER]):…
Noor Ahmed
  • 11
  • 1
0
votes
1 answer

Eiffel sqlite call with extra parameters

I have copied some code from an example for accessing an sqlite database. It uses an agent to get the returned rows: check_db (input_line: STRING) local df_db: SQLITE_DATABASE df_db_query: SQLITE_QUERY_STATEMENT …
shakeshuck
  • 95
  • 1
  • 5
0
votes
1 answer

EiffelStudio compile error: The use of `tempnam' is dangerous, better use `mkstemp'

I'm using eiffelstudio-bin 17.05.100416-1 installed via AUR in Arch. When I try to run the default hello world project, i have this error in the Error List tab: C Compiler Error: The use of `tempnam' is dangerous, better use `mkstemp' …
rivamarco
  • 719
  • 8
  • 23
0
votes
1 answer

Modify class attributes in Eiffel

Goodmorning. I've starting using Eiffel at the University. I have this example: class CLASS_1 create make feature x: INTEGER make do x:=0 end increment(inc: INTEGER) do …
Gongus
  • 3
  • 2
0
votes
2 answers

How to iterate array in precondition?

I want to iterate through array in a precondition. But It seems precondition part doesn't allow use of "from" and "across" syntax. Is there a way to iterate through array in precondition? insert_last (s: STRING) require …
Miku
  • 41
  • 1
  • 5
0
votes
1 answer

Error trying to traverse an array in Eiffel

I get an error unknown identifier 'start' my code: visit_table(table: ETABLE) local t_array: ARRAY[ARRAY[ELEMENT]] b_header: BOOLEAN row_index: INTEGER do t_array := table.t_array b_header :=…
0
votes
1 answer

Getting stack trace from geant

I'm trying to compile a project (see this SO question) using Gobo compiler and its tools and I'm getting error messages refering to standard library equal(..). I'm sure that error is somewhere in the code I have and not in standard library but I…
Grzegorz Adam Kowalski
  • 5,243
  • 3
  • 29
  • 40
0
votes
2 answers

STRING_8 does not conform to STRING_UC in is_equal

I'm trying to build xplain2sql using Gobo compiler and its tools. After issuing geant compile command I get a lot of similar errors: [CATCALL] class SQL_GENERATOR_TSQL65 (SQL_GENERATOR,2610,5): type 'STRING_8' of actual argument #1 does not…
Grzegorz Adam Kowalski
  • 5,243
  • 3
  • 29
  • 40
0
votes
1 answer

How to instant casting in eiffel

I have following code in my do~end scope of some feature: add (tempA, tempB) Here, type of arguments are: tempA: A tempB: B Both are declared as local variable. And, here is prototype of feature add: add (a: A; b: B) The compile error I…
Miku
  • 41
  • 1
  • 5
0
votes
1 answer

detachable generic to generic in eiffel

I have a feature with post-condition as follow: checkValue (k: K): detachable V do ... end ensure some_post_condition: checkKey (Result) And here is prototype of "checkKey": checkKey (v: V): BOOLEAN Since "Result" is type of "detachable V",…
Miku
  • 41
  • 1
  • 5
0
votes
1 answer

Generic to integer conversion in Eiffel

I have some codes like follow: keys: LINKED_LIST[K] ... test local tempK:K tempI:INTEGER do ... across keys as cursor loop tempK := cursor.item if tempK ~ 1 then tempI := tempK end end ... end "cursor.item" is type of…
Miku
  • 41
  • 1
  • 5
0
votes
1 answer

Eiffel inheritance and cursor usage [can't compile]

I have following test case: test_different_cursor: BOOLEAN local cursor: SET_ITERATION_CURSOR[INTEGER, INTEGER] sets: ARRAY[SET[INTEGER, INTEGER]] do create sets.make_empty check …
Miku
  • 41
  • 1
  • 5
0
votes
1 answer

Returning ITERABLE type in Eiffel

I am trying to return Result type being ITERABLE[K]. All I know is that Iterable inherits from ITERATION_CURSOR, so that I made following unworking code but it doesn't compile. obtainKey (v: V): ITERABLE[G] local myCollection: ITERABLE…
Miku
  • 41
  • 1
  • 5
0
votes
1 answer

Deep copy always fails in workbench system

I have found one case that does not make sense. I have following feature: test_array_deep_copy: BOOLEAN local imp, old_imp: ARRAY[STRING] do comment("Test of a deep copy.") create {ARRAY[STRING]}…
Kam
  • 63
  • 11