ikhono.net

"Hello, Eiffel World!" - Part 4: Information Hiding 0

Posted on Saturday, March 29

This is part 4 of my ongoing series about programming with Eiffel and EiffelStudio. In part 1 we installed EiffelStudio, part 2 introduced the Eiffel vocabulary, and in part 3 we wrote our first Eiffel application.

Today we are going to add a new class and use information hiding in Eiffel.

Hide and Seek

Photo credit

Continue reading...

"Hello, Eiffel World!" - Part 3: EiffelStudio 0

Posted on Monday, December 31

This is part 3 of my ongoing series about programming with Eiffel and EiffelStudio. See part 1 on how to install EiffelStudio and part 2 for an introduction to the Eiffel vocabulary.

In this part we finally write our first Eiffel application.

Hello, World!

Photo credit

Continue reading...

"Hello, Eiffel World!" - Part 2: Tower of Babel 0

Posted on Saturday, December 29

This is part 2 of my ongoing series about programming with Eiffel and EiffelStudio. See part 1 on how to install EiffelStudio.

Before we start programming, I’d like to introduce some of Eiffel’s basic principles and special vocabulary.

Tower of Babel

Photo credit

Continue reading...

"Hello, Eiffel World!" - Part 1: Introduction 0

Posted on Wednesday, December 26

The object-oriented programming language Eiffel was designed by Betrand Meyer in 1985. The name is an homage to Gustave Eiffel, who among other things built the metal scaffolding of the Statue of Liberty in New York and the Eiffel Tower in Paris.

With Eiffel, Meyer created a tool, which enables developers to construct large software systems out of reusable and easily maintainable modules. This series of articles introduces the programming language Eiffel and describes how to develop applications with EiffelStudio.

Eiffel Tower

Photo credit

Continue reading...

CAT calls in Eiffel 0

Posted on Monday, December 10

Eiffel is statically typed, which means that type checking is performed during compile-time as opposed to run-time. Therefore it should be guaranteed that no execution of a valid program will ever produce a run-time type failure.

To be a little bit more precise, an Eiffel program is class-level-valid if it satisfies the following properties:

  • In every assignment x := y - either explicit or through argument passing - type of y conforms to type of x.
  • In every qualified feature call x.f(...), f is an exported feature of the class of x.

Without so-called CAT calls, any class-level-valid program would be type-safe. The acronym CAT stands for Change of Availability or Type.

No cat calls

Photo credit

Continue reading...

Convertibility in Eiffel 0

Posted on Saturday, December 08

Conformance determines when a type may be used instead of another. The conformance mechanism relies on inheritance:

A is conform to B if the base class of A is a descendant of the base class of B.

Convertibility completes the conformance mechanism. Convertibility lets you perform assignment and argument passing in cases where conformance does not hold but you still want the operation to succeed after adapting the source value to the target type. For example:


my_real := 42   -- my_real: REAL, i.e. my_real is of type REAL

Many classes in Eiffel Base, like INTEGER, STRING, etc. support conversion. In this article I’d like to show you how to add convertibility to your own classes.

1/2

Photo credit

Continue reading...

Object-Oriented Software Construction 0

Posted on Wednesday, November 28

All you need is code
Code is all you need

  – The bOOtles

(Source: Slides of a talk about the “Eiffel Method” by Betrand Meyer)

Amber Scripting Language 0

Posted on Monday, July 02

While browsing EiffelZone for new Eiffel related releases, I stubled across Amber, an Eiffel-like scripting language.

The highlights of Amber are

  • Syntax and semantics somewhere between those of Ruby and Eiffel
  • Scales well to large systems, thanks to built-in support for Design by Contract
  • Concise syntax, easy to read and maintain
  • Dynamic typing

The Amber Scripting Language is still experimental. Nevertheless, the included hand-crafted examples and test cases do work. Following is the “99 Bottles of Beer” implementation of Amber:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
-- Prints the song "99 Bottles of Beer"
-- See http://99-bottles-of-beer.net/

99.down_to(1, agent(n) do
   print_line(bottles(n) & " on the wall, " & bottles(n) & ".")
   if n = 0 then
      print_line(
         "Go to the store and buy some more ... 99 bottles of beer."
      )
   else
      print("Take one down and pass it around, ")
      print_line(bottles(n - 1) & " on the wall.\n")
   end
end)

private
   bottles(n)
      is
         if n = 0 then
            "No more bottles of beer"
         elseif n = 1 then
            "1 bottle of beer"
         else
            n & " bottles of beer"
         end
      end
end

EiffelStudio 6.0 released 0

Posted on Wednesday, June 27

In mid-April, Eiffel Software announced a changed in its release cycle by having two EiffelStudio releases per year (one in mid-May and one in mid-November). This would really start this Fall (i.e Fall in the northern hemisphere) since for this Spring, it was decided to have a release by mid-June. I’m happy to report that we have been on time and released EiffelStudio 6.0 on June 19th.

For more information see Manu’s Eiffel blog.

Snippets for EiffelStudio 0

Posted on Saturday, June 23

Snippets in EiffelStudio

For a software architecture course at university, two colleagues and I implemented snippet support for EiffelStudio.

I see our implementation as a proof of concept that showed it is quite easy to support snippets in the EiffelStudio editor. But I think the snippets support is to primitive to be really useful. If I find some time, I’d like to implement snippet support simliar to NetBeans, Emacs and/or Gedit.

Go to the project page for more information about snippets in EiffelStudio. If you want to know more about snippets in general, see Wikipedia.