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

Problems compiling Traffic library

I attempted to install the Traffic library for the book "A Touch of Class" but was not able to compile the examples. EiffelStudio complained about a base2.ecf file. Error code: VD00 General configuration parsing error. What to do: fix the…
Hank Lenzi
  • 81
  • 1
  • 6
0
votes
1 answer

Eiffel: type conformance, how to give a type instead of an instance

General I don't understand why there are like 2 generating_type kinds, the one with exclamation point, and the other not. My case I have a function returning a DB_SERVICE[G] from a given instance from a collection of db_services so that from another…
Pipo
  • 4,653
  • 38
  • 47
0
votes
1 answer

Eiffel: Creating a datetime with '' format

Seems I'm wrong creating a datetime from string using this method, any idea why? The precondition violates on date_time_valid: date_time_valid (s, code) create l_date_time.make_from_string ("2019-03-28T15:28:02Z", "yyyy-mm-ddThh:mi:ssZ")
Pipo
  • 4,653
  • 38
  • 47
0
votes
1 answer

Eiffel shortest statement for object creation and result of function

If I'd like to add a DATE_TIME to a logger for example I'd like to avoid creating a local variable for that. Is there any similar statement as create {DATE_TIME}.make_now.formatted_out ("yyyy-mm-dd hh:mi:ss") which is not possible?
Pipo
  • 4,653
  • 38
  • 47
0
votes
1 answer

Eiffel: a way to display assertion violation on runtime of executable

As I have the choice on finalizing a project to keep assertions, I'd think that assertion violation would be shown or displayed on console (hopefully on stderr on linux). What would be the proper way to do such, like seems that I have to add it or…
Pipo
  • 4,653
  • 38
  • 47
0
votes
1 answer

Eiffel: how do I set the command line arguments of an autotest?

Some of my tests needs something like {EXECUTION_ENVIRONMENT}.arguments.separate_character_option_value ('l') to be attached (not Void), how do I set commandline arguments to eiffel autotest?
Pipo
  • 4,653
  • 38
  • 47
0
votes
1 answer

Eiffel: a proper way to inherit from a class and convert Current object to it

It's not the first time I'm trying to inherit from a class and convert an object to it, in this case extend functionalities of HTTP_CLIENT_RESPONSE with valid_http_response => response.status = 200, valid_http_json_body => validate json content,…
Pipo
  • 4,653
  • 38
  • 47
0
votes
1 answer

Eiffel: non-compatible actual argument in feature call

I don't understand why it is so. If I say attached {G} it works If I say nothing which would be the expected behavior for me calling_entity: detachable RELATED_DB_ENTITY should be conform (once attached) to G which is -> DB_ENTITY If I say…
Pipo
  • 4,653
  • 38
  • 47
0
votes
2 answers

Eiffel: setting a constant with reference to other class constant

How to set a constant refering to another class constant in Eiffel? Something like that doesn't compile unfortunately Default_log_level: like {MY_LOGGER}.log_level = {MY_LOGGER}.Log_level_info
Pipo
  • 4,653
  • 38
  • 47
0
votes
1 answer

eiffel: does the across structure move the cursor of current iterable structure?

I was wondering if the across structure uses an own cursor or a separated one? does it ensure that cursor hasn't moved and if so how can it be expressed for other examples?
Pipo
  • 4,653
  • 38
  • 47
0
votes
1 answer

Eiffel: multilines string formatting

Didn't find a better way to format a multiline string than this way... seems complicated. What would be the best way to format this type of code? l_qry := "SELECT% % * % %FROM % % enumerate % %WHERE % % " + {like…
Pipo
  • 4,653
  • 38
  • 47
0
votes
2 answers

Eiffel: REAL_32.to_double gives a strange value

Trying to transform a real_32 to real_64, I'm getting real_32: 61.55 real_64: 61.54999923706055 Am I wrong with the to_double function?
Pipo
  • 4,653
  • 38
  • 47
0
votes
1 answer

Eiffel: void safety, a concise way to test if an object exists and then call its feature

I was wondering if there is a clearer statement then if not attached foo then create foo end if attached foo as l_foo then l_foo.bark end as if not attached foo then create foo foo.bark else foo.bark end would repeat the…
Pipo
  • 4,653
  • 38
  • 47
0
votes
1 answer

Eiffel: how to use old keyword in ensure contract clause with detached

How to use the old keyword into ensure clause of a feature, the current statement doesn't seem to be valid at runtime relationships: CHAIN -- any chain some_feature do (...) ensure relationship_added: attached relationships as…
Pipo
  • 4,653
  • 38
  • 47
0
votes
1 answer

Eiffel: Error: variable is not properly set. in make calling default_create or any parent calling/redefining default_create

Not sure exactly, but it makes various time I got a Error: variable is not properly set. in creation procedures' calling order. I figured out that creating class attributes before calling default_create seemed to solve the problem. Why is that so?…
Pipo
  • 4,653
  • 38
  • 47