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 get a true value when using object_comparison on an empty linked list in my post condition?

I have an assignment that requires me to create an empty linked list key: LINKED_LIST [KEY], another linked list data_items_1: LINKED_LIST [DATA1] and a hash table data_items_2: HASH_TABLE [DATA2, KEY] in the constructor. The post condition that my…
0
votes
1 answer

How do I use an across loop in post condition to compare an old array and new array at certain indices?

I have a method that shifts all the items, in an array, to the left by one position. In my post condition I need to ensure that my items have shifted to the left by one. I have already compared the first element of the old array to the last element…
0
votes
2 answers

semantic of having to declare an attached local into detachable attribute with mandatory check

As far as I understood the check with then is mandatory. So what is the semantic of having to declare a local to avoid compiling error (object could be void)? detachable dog: DOG take_a_walk do check attached_dog: attached…
Pipo
  • 4,653
  • 38
  • 47
0
votes
1 answer

why is that I can't create an instance_free feature in a deferred class?

I'd like to create a class with both an instance_free (ensure class) feature and a deferred one. why is that I can't call an instance_free feature in a deferred class but only on a descendant? Don't understand the logic of that... is there for…
Pipo
  • 4,653
  • 38
  • 47
0
votes
1 answer

Eiffel: a way to call precursor redefined feature on another function

I'm looking for a way to call Precursor on another feature. The context is that I redefine a routine calling another heir's feature that calls mine, and I'd like to call it explicitly. Is there a way to do something such as in java…
Pipo
  • 4,653
  • 38
  • 47
0
votes
2 answers

Eiffel: a way to get target and project name @runtime

Is there a way to get the project name and target at execution time or is it not stored into executable?
Pipo
  • 4,653
  • 38
  • 47
0
votes
1 answer

Eiffel: best way to create a redefinable "constant"

As mentioned on this question, there is no way to define a constant which I can redefine into a descendant. In many of my cases, I'd like to have a constant which I can redefine. The alternatives I see to avoid a creation on each consultation …
Pipo
  • 4,653
  • 38
  • 47
0
votes
1 answer

Eiffel: regular expressions how to do grouping

I'd like to do grouping of regular expressions with eiffel. How do I do something like l_reg.compile ("^([0-9]{3}) (rabbit[0-9]).*") l_groups := l_reg.groups ("123 rabbit1") my_first_rabbit := l_groups.at (2) Didn't find any example on groups,…
Pipo
  • 4,653
  • 38
  • 47
0
votes
1 answer

Eiffel: percent character into a string

How do I concatenate a percent % string to a string? as either do not work s := "%%" + s + "%" I know its a special character but don't afford it neither do I find the doc... UPDATE The answer was one of my attempts, but it could stay an issue of…
Pipo
  • 4,653
  • 38
  • 47
0
votes
1 answer

Eiffel: syntax error on multiple Generic constraint

As per this documentation, I'm trying to constrain a Generic parameter to 2 classes and need a default_create creation procedure call in my implementation. I'm getting a Syntax error from compiler on the select clause. Why is that so? I thought…
Pipo
  • 4,653
  • 38
  • 47
0
votes
1 answer

Eiffel: Where can I find a reference with common features lists?

Am looking for typical feature {NONE} -- Initialization (semantic) feature -- Status Settings (semantic) ..... Where can I find that list with semantic? Didn't find it into ECMA
Pipo
  • 4,653
  • 38
  • 47
0
votes
1 answer

Eiffel: best way to compare types without getting a catcall

Got a Catcall trying to compare 2 types, how could I do that avoiding passing through another not dedicated method (like to string, class_id or stuff like that)? SIT_UTIL class_name_lowercase (a_string: STRING): STRING -- a copy…
Pipo
  • 4,653
  • 38
  • 47
0
votes
2 answers

Eiffel: a way to check type conformance with a given CLASS_NAME

I'm trying to do something as work (a_father: FATHER) do if a_father.conforms_to ({DEVELOPER}) then a_father.code else a_father.change_job ({DEVELOPER}) end end the compilation works, but in…
Pipo
  • 4,653
  • 38
  • 47
0
votes
2 answers

Eiffel, multiple types conformance: a way to specify that a parameter is a descendent from A and B?

Is there a way (I'm sure there is out of runtime check...) to specify that a parameter or a variable in general conforms to multiple types? to avoid doing something such as work (a_printer: PRINTER; a_scanner: SCANNER) do a_printer.print …
Pipo
  • 4,653
  • 38
  • 47
0
votes
2 answers

€ Symbol from commandline (Arguments)

I have a simple euro_to_dm command line program written but the "€" symbol doesn't work. The example change every time "dm to euro" but not "€ to dm". Sorry for my English. Ubuntu 19.4 ise-eiffel AND liberty-eiffel class EURO inherit…