Saturday, December 18, 2010

What this has been before...

This blog space was actually used as my personal journal!

It was full of garbage, feelings, grievances, poems! I was so scared people will mock at me if someone sees those things. Right now, I feel embarrassed reading what I have written before. Those posts were about what I felt about certain things. The only point I saw in those posts, is that I'm too sensitive for this world. It's not the same protective environment which I used to live before.


I guess I could change my self. I'm now quite able to let go of things, without just holding them tight. That's one thing which added value to my life, and no matter what others think, I think that's one of the best things that ever happened to me.

So now on, I intend to use this few MB I have on internet for some useful thing. :)

Wednesday, June 2, 2010

Eiffel Overview

 

This post is for the sake of remembering and learning the basics of Eiffel.......................

You can create classes like any other oo language, in Eiffel.

Before anything here's famous "Hello World"

class Hello
create 
     make
feature
    make is
         print("Hello world")
    end -- end make
end    -- end class

create = constructor
feature = instance var, methods
is = definition of feature
(is - end) = a block - { code goes here}

Compared with java, similar to  instance variables, and methods Eiffel has "Features"
Features are divided into 3 sections
Procedures : change state of a attribute
Functions : return answer to a query of a state of a object, do not change state
Attribute :  the states of the object considered are declared there

routines : Procedures+ (computational) Functions

simple declarations
    size : INTEGER
    name : STRING
    myList : ARRAY[TYPE]

simple procedure
       set_size(s: like size) is do size := s end
simple function
       get_size : INTEGER is do Result := size end
       Note: here Result is always the return value for a function

create an instance from another class
      create make_duck(size)

additional to these simple facts,
keywords such as require and ensure enable to have pre and post conditions for a specific function or     procedure, this restring the false conditions that might occur when passing arguments.

Tested with EiffelStudio 6.6

[Reference: http://eiffelzone.com/doc/into-eiffel.html
                  Eiffel: The Essentials by Meyer]