Example

article

Variant of Producer Consumer SCOOP example

With some help from several people and ISE support I got a producer cosnumer exampe passing STRINGs working.

When logging information in a multi threaded system I wanted one thread to handle all writing to a file. The difference from the Producer Consumer example is mainly that I pass a STRING in a queue instead of an INTEGER.

It seems to be some problems with the fiel attachemnts.

article

Underused expanded types

Using expanded types for enumerations or aliased type names:

expanded class MY_ENUMERATION
convert
 value: {INTEGER_32}
feature
 make (value_a: INTEGER_32)
  do
   value := value_a
  end
feature
 value: INTEGER_32
end

It's as simple as that.

article

Output and by-reference parameters

This request is retracted, see http://www.eiffelroom.org/node/467 for a demonstration of an Object Oriented way of doing output and byref parameters.

I'm trying to lay out a case for adding parameter passing by value and/or output parameters.

article

Why doesn't it work?

I start using I/O in eiffel, and my first program doesn't work.


	make
	local
      input : PLAIN_TEXT_FILE
      output : PLAIN_TEXT_FILE
      internal : ARRAY[CHARACTER]
      i, j : INTEGER
    do
      io.putstring ("Welcome to file-io land!

article

Trouble with array of linked_list elements

I represent an adjacency list of graph G(V,E).

article

The rescue clause does not work

I've tested the system by an example of exception handling in Eiffel

 <eiffel>
feature {NONE} -- Initialization
	i:INTEGER
	x:REAL
	y:ARRAY[REAL]
	make
			-- Run application.
		do
			create y.make(1,2)
			io.put_string ("The item at position: ")
			io.read_integer
			i:=io.last_integer
			find
			io.put_string (" is: ")
			io.put_real (x)
			io.put_string ("%NReturn to make i

article

Attachment in creation features with exceptions

This is a short template of what one can do when dealing with the perfect storm of complication using attached variables. This issue can arise when you need to attempt to release a resource, e.g.

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.

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.

Syndicate content