eiffelroom

Example

article

Eiffel for Rubyists

After several months programming with Ruby scripting language, and related libraries, I got quite used to the intensive use of iterators and blocks (closures) that give Ruby programs a particular coding flavour.

article

C/C++ calls and callbacks

Most existing examples on how to do external calls contain a lot of English explanation which can distract people, like myself, who learn by example. This is intended to be a compilable, terse example of how to call in and out of C/C++.

This is a C example: <eiffel> class APPLICATION

create make

feature -- Initialization

make is -- Run application. do

article

Serialization to string

Since some time Eiffel supports a serialization method completely written in Eiffel. It directly supports serialization to a file or to memory. This example shows how to use this to serialize an arbitrary object structure to a string.

article

Random numbers

People who are used to other programming languages usually use some kind of rand, rnd or similar function to generate random numbers. This article shows how you can do it in Eiffel.

Generating a random number

The base library's RANDOM class is modeled as a sequence of random numbers.
article

Simple timer class

Sometimes in an application, some actions have to be repeatedly performed in a certain interval. This could for example be some cleanup of external data. To do this I wrote a small class that takes an agent and an interval. <eiffel> indexing description: "Execute an action every interval until stopped." author: "Patrick Ruckstuhl <patrick@tario.org>" date: "$Date$"

article

Daemon howto

On Unix/Linux a daemon is a program that runs in the background independent from the logged in user.

The way to achieve this is normally to directly fork after the execution and let the parent process exit. This results in the child process having lost its parent which leads to the init process automatically inheriting this process.

article

Calculator

Basic calculator in reverse Polish form.

article

Hello World

The typical hello world program in Eiffel.

To compile it create a file called hello_world.e with the following content:

class HELLO_WORLD

create
  make

feature

  make
      -- Program entry
    do
      print ("Hello World!")
    end

end

Syndicate content
about - contact