49
LRDE April 22 th 2009 1 http://SmartEiffel.loria.fr [email protected] Introducing (Smart) Eiffel. Design by contract. Software engineering. Multiple inherit / insert. Agents. Compiler technology. SmartEiffel The GNU Eiffel Compiler Tools and Libraries

SmartEiffel The GNU Eiffel Compiler Tools and Libraries ... · PDF file LRDE April 22th2009 27 local integer: INTEGER list: LINKED_LIST[INTEGER] do create list.make list.add_last(1)

Embed Size (px)

Citation preview

Page 1: SmartEiffel The GNU Eiffel Compiler Tools and Libraries ... · PDF file LRDE April 22th2009 27 local integer: INTEGER list: LINKED_LIST[INTEGER] do create list.make list.add_last(1)

LRDE April 22th2009 1http://SmartEiffel.loria.fr

[email protected]

Introducing (Smart) Eiffel. Design by contract. Software engineering. Multiple inherit / insert.

Agents. Compiler technology.

SmartEiffel The GNU Eiffel Compiler Tools and Libraries

Page 2: SmartEiffel The GNU Eiffel Compiler Tools and Libraries ... · PDF file LRDE April 22th2009 27 local integer: INTEGER list: LINKED_LIST[INTEGER] do create list.make list.add_last(1)

LRDE April 22th2009 2http://SmartEiffel.loria.fr

LispSmalltalk

Self

1960 1972 1980 1989 1995 2005

J.McCarthy

Ada

Eiffel SmartEiffel

CAML

SmallEiffel

2012

Simula­67O.J.Dahl K.Nygaard

A.Goldberg72­80 Squeak

B.Meyer86­89­ECMA

May 2005

July 1995 ­0.99 to ­0.75

G.Masini, A.Napoli, D.Colnet, D.Léonard, K.Tombre“Les langages à objets”1989 ­ ISBN 2­7296­0275­5

83­9X

D.Ungar87

MLR.Milner

78­84

87

OCAML96

Lisaac2003

Page 3: SmartEiffel The GNU Eiffel Compiler Tools and Libraries ... · PDF file LRDE April 22th2009 27 local integer: INTEGER list: LINKED_LIST[INTEGER] do create list.make list.add_last(1)

LRDE April 22th2009 3http://SmartEiffel.loria.fr

Initial Author and Origins

Object-Oriented Software

ConstructionBertrand Meyer1988 Prentice Hall

Eiffel

Page 4: SmartEiffel The GNU Eiffel Compiler Tools and Libraries ... · PDF file LRDE April 22th2009 27 local integer: INTEGER list: LINKED_LIST[INTEGER] do create list.make list.add_last(1)

LRDE April 22th2009 4http://SmartEiffel.loria.fr

Goals / Market

Quality Software Design

Re-Usability

Security

Efficiency

Large Team / SoftwareKeep those goals in mind.

SmartEiffel

http://shootout.alioth.debian.org

Page 5: SmartEiffel The GNU Eiffel Compiler Tools and Libraries ... · PDF file LRDE April 22th2009 27 local integer: INTEGER list: LINKED_LIST[INTEGER] do create list.make list.add_last(1)

LRDE April 22th2009 5http://SmartEiffel.loria.fr

Efficiency: runtime requirementsinteger: INTEGER string1: STRING string2: STRING

integer := 2string1 := “foo”string2 := Void

integerstring1string2

2“foo”

Void

Page 6: SmartEiffel The GNU Eiffel Compiler Tools and Libraries ... · PDF file LRDE April 22th2009 27 local integer: INTEGER list: LINKED_LIST[INTEGER] do create list.make list.add_last(1)

LRDE April 22th2009 6http://SmartEiffel.loria.fr

EiffelStrong Static Typing (Genericity)Design by Contracts (Assertions)Truly Object-Oriented (Class Based)Mult iple inherit / insertPowerful Exportation RulesAnchored Type Definit ionInfix / Prefix Operator Definit ionfrozen MethodsAbstract Class / Methods

Page 7: SmartEiffel The GNU Eiffel Compiler Tools and Libraries ... · PDF file LRDE April 22th2009 27 local integer: INTEGER list: LINKED_LIST[INTEGER] do create list.make list.add_last(1)

LRDE April 22th2009 7http://SmartEiffel.loria.fr

Eiffelonce Methodsobsolete Class / Methodsagents (Code Manipulation)low level interface with C ..., SCOOP (concurrency)?

More than a Language !

Page 8: SmartEiffel The GNU Eiffel Compiler Tools and Libraries ... · PDF file LRDE April 22th2009 27 local integer: INTEGER list: LINKED_LIST[INTEGER] do create list.make list.add_last(1)

LRDE April 22th2009 8http://SmartEiffel.loria.fr

Eiffel/S 1.3

9minutes

SmallEiffel #1

SmallEiffel56seconds

#2

SmallEiffel35

seconds35

seconds

#2

56 / 35 = 1.6

BOOTSTRAP PROCESS 1997 data

All written in Eiffel (new technology)

Page 9: SmartEiffel The GNU Eiffel Compiler Tools and Libraries ... · PDF file LRDE April 22th2009 27 local integer: INTEGER list: LINKED_LIST[INTEGER] do create list.make list.add_last(1)

LRDE April 22th2009 9http://SmartEiffel.loria.fr

The exampleclass HELLO

-- My first class.create

world

feature

world isdo

io.put_string(“Hello World !%N”)end

end -- Of my HELLO class.

Looks like Pascal / Ada.

Page 10: SmartEiffel The GNU Eiffel Compiler Tools and Libraries ... · PDF file LRDE April 22th2009 27 local integer: INTEGER list: LINKED_LIST[INTEGER] do create list.make list.add_last(1)

LRDE April 22th2009 10http://SmartEiffel.loria.fr

syntaxmy_procedure (arg1: INTEGER; arg2: STRING) is

-- The purpose of this procedure is just to show the syntax.local

i: INTEGERdo

if arg1 > 0 thenfrom

i := arg1until

i = 0loop

print(arg2.to_string + “%N”)i := i - 1

endelse

print(“Easy to read for beginners too.”)end

end

Page 11: SmartEiffel The GNU Eiffel Compiler Tools and Libraries ... · PDF file LRDE April 22th2009 27 local integer: INTEGER list: LINKED_LIST[INTEGER] do create list.make list.add_last(1)

LRDE April 22th2009 11http://SmartEiffel.loria.fr

New 2004 ­2006

Implementationinheritancemultiple

Subtypinginheritancemultiple

Page 12: SmartEiffel The GNU Eiffel Compiler Tools and Libraries ... · PDF file LRDE April 22th2009 27 local integer: INTEGER list: LINKED_LIST[INTEGER] do create list.make list.add_last(1)

LRDE April 22th2009 12http://SmartEiffel.loria.fr

SubtypingPolymorphism

ImplementationNo Polymorphism

ANY : the only one class with no ancestor (the common ancestor).

+ = Acyclic Directed Graph.

Page 13: SmartEiffel The GNU Eiffel Compiler Tools and Libraries ... · PDF file LRDE April 22th2009 27 local integer: INTEGER list: LINKED_LIST[INTEGER] do create list.make list.add_last(1)

LRDE April 22th2009 13http://SmartEiffel.loria.fr

ANY

B C

D E

F

Inherit relationship:B inherits from ANYD inherits from ANYD inherits from BD inherits from CE inherits from CF inherits from ANY

C inserts ANYE inserts ANYF inserts BF inserts CF inserts D

Insert relationship:

Page 14: SmartEiffel The GNU Eiffel Compiler Tools and Libraries ... · PDF file LRDE April 22th2009 27 local integer: INTEGER list: LINKED_LIST[INTEGER] do create list.make list.add_last(1)

LRDE April 22th2009 14http://SmartEiffel.loria.fr

● What can be assigned into what?

● What type can be used when some method or attribute is overridden?

● What type can be used in case of a generic derivation?

● What about constrained genericity?

Typing and Checking Policy

Page 15: SmartEiffel The GNU Eiffel Compiler Tools and Libraries ... · PDF file LRDE April 22th2009 27 local integer: INTEGER list: LINKED_LIST[INTEGER] do create list.make list.add_last(1)

LRDE April 22th2009 15http://SmartEiffel.loria.fr

Typing and Checking Policy

● Rule 1 (assignment): An expression of type A can be assigned into a variable of type B if and only if A and B are the same type or A inherits from B.

● Rule 2 (argument passing): An expression of type A can be passed as an argument of formal type B if and only if A and B are the same type or A inherits from B.

Page 16: SmartEiffel The GNU Eiffel Compiler Tools and Libraries ... · PDF file LRDE April 22th2009 27 local integer: INTEGER list: LINKED_LIST[INTEGER] do create list.make list.add_last(1)

LRDE April 22th2009 16http://SmartEiffel.loria.fr

Typing and Checking Policy● Rule 3 (redefinition under inheritance): When 

overriding an inherited method or attribute, the type of any argument and/or of its result can be replaced covariantly with a type that inherits from the replaced type (i.e. a subtype).

CAT calls are still there!

Page 17: SmartEiffel The GNU Eiffel Compiler Tools and Libraries ... · PDF file LRDE April 22th2009 27 local integer: INTEGER list: LINKED_LIST[INTEGER] do create list.make list.add_last(1)

LRDE April 22th2009 17http://SmartEiffel.loria.fr

Typing and Checking Policy● Rule 4 (redefinition under insertion): When overriding 

an inserted method or attribute, the type of any argument and/or of its result can be replaced covariantly with a type that inherits from or inserts the replaced type.

No CAT calls here!

Page 18: SmartEiffel The GNU Eiffel Compiler Tools and Libraries ... · PDF file LRDE April 22th2009 27 local integer: INTEGER list: LINKED_LIST[INTEGER] do create list.make list.add_last(1)

LRDE April 22th2009 18http://SmartEiffel.loria.fr

COLOR_LIST

STATE_CONSTANTS

ALIGNMENT_CONSTANTS

GRAPHIC

Page 19: SmartEiffel The GNU Eiffel Compiler Tools and Libraries ... · PDF file LRDE April 22th2009 27 local integer: INTEGER list: LINKED_LIST[INTEGER] do create list.make list.add_last(1)

LRDE April 22th2009 19http://SmartEiffel.loria.fr

COLLECTION[E_]

FAST_ARRAY[E_]

LINKED_LIST[E_]

ARRAY[E_]

TWO_WAY_LINKED_LIST[E_]

RING_ARRAY[E_]

Page 20: SmartEiffel The GNU Eiffel Compiler Tools and Libraries ... · PDF file LRDE April 22th2009 27 local integer: INTEGER list: LINKED_LIST[INTEGER] do create list.make list.add_last(1)

LRDE April 22th2009 20http://SmartEiffel.loria.fr

COLLECTION[E_]

FAST_ARRAY[E_]

LINKED_COLLECTION[E_]

LINKED_LIST[E_]

ARRAY[E_]

TWO_WAY_LINKED_LIST[E_]

RING_ARRAY[E_]

Page 21: SmartEiffel The GNU Eiffel Compiler Tools and Libraries ... · PDF file LRDE April 22th2009 27 local integer: INTEGER list: LINKED_LIST[INTEGER] do create list.make list.add_last(1)

LRDE April 22th2009 21http://SmartEiffel.loria.fr

COLLECTION[E_]

FAST_ARRAY[E_]

LINKED_COLLECTION[E_] ARRAYED_COLLECTION[E_]

LINKED_LIST[E_]

ARRAY[E_]

TWO_WAY_LINKED_LIST[E_]

RING_ARRAY[E_]

Page 22: SmartEiffel The GNU Eiffel Compiler Tools and Libraries ... · PDF file LRDE April 22th2009 27 local integer: INTEGER list: LINKED_LIST[INTEGER] do create list.make list.add_last(1)

LRDE April 22th2009 22http://SmartEiffel.loria.fr

COLLECTION[E_]

FAST_ARRAY[E_]

LINKED_COLLECTION[E_] ARRAYED_COLLECTION[E_]

STACK[E_] QUEUE[E_]

LINKED_LIST[E_]

ARRAY[E_]

TWO_WAY_LINKED_LIST[E_]

RING_ARRAY[E_]

Page 23: SmartEiffel The GNU Eiffel Compiler Tools and Libraries ... · PDF file LRDE April 22th2009 27 local integer: INTEGER list: LINKED_LIST[INTEGER] do create list.make list.add_last(1)

LRDE April 22th2009 23http://SmartEiffel.loria.fr

CREATE_SUPPORT

CREATE_EXPRESSION

INSTRUCTION EXPRESSION

CODE

CREATE_INSTRUCTION

Page 24: SmartEiffel The GNU Eiffel Compiler Tools and Libraries ... · PDF file LRDE April 22th2009 27 local integer: INTEGER list: LINKED_LIST[INTEGER] do create list.make list.add_last(1)

LRDE April 22th2009 24http://SmartEiffel.loria.fr

riented-- Somewhere in a routine.local

point: POINTdo

create point.with(2.5, 6.7)point.translate(1.1, 2.2)point.display_on(std_output)...

Check for the traditional POINTclass in our tutorial.

bject­

-- Somewhere in a routine.local

string: STRING; integer: INTEGERdo

integer := 2 + 2string := integer.to_string...

class INTEGERclass STRING

class CHARACTER

class BOOLEAN

class REAL

class ...class ...

Page 25: SmartEiffel The GNU Eiffel Compiler Tools and Libraries ... · PDF file LRDE April 22th2009 27 local integer: INTEGER list: LINKED_LIST[INTEGER] do create list.make list.add_last(1)

LRDE April 22th2009 25http://SmartEiffel.loria.fr

x := y.foox := y.foo

Uniform access. 

No direct write permission on attribute (Smalltalk way). 

Page 26: SmartEiffel The GNU Eiffel Compiler Tools and Libraries ... · PDF file LRDE April 22th2009 27 local integer: INTEGER list: LINKED_LIST[INTEGER] do create list.make list.add_last(1)

LRDE April 22th2009 26http://SmartEiffel.loria.fr

x := y.foo

Uniform access. 

No direct write permission on attribute (Smalltalk way). 

?

?

Page 27: SmartEiffel The GNU Eiffel Compiler Tools and Libraries ... · PDF file LRDE April 22th2009 27 local integer: INTEGER list: LINKED_LIST[INTEGER] do create list.make list.add_last(1)

LRDE April 22th2009 27http://SmartEiffel.loria.fr

localinteger: INTEGERlist: LINKED_LIST[INTEGER]

docreate list.makelist.add_last(1)integer := list.last...

No Cast !

localstring: STRINGlist: LINKED_LIST[STRING]

docreate list.makelist.add_last(“foo”)string := list.last...

localstring: STRINGarray: ARRAY[STRING]list: LINKED_LIST[ARRAY[STRING]]

docreate array.make(1, 1)array.put(“foo”)create list.makelist.add_last(array)string := list.last.item(1)...

Compile­Time checks !

Works on all types.

Page 28: SmartEiffel The GNU Eiffel Compiler Tools and Libraries ... · PDF file LRDE April 22th2009 27 local integer: INTEGER list: LINKED_LIST[INTEGER] do create list.make list.add_last(1)

LRDE April 22th2009 28http://SmartEiffel.loria.fr

put (c: CHARACTER; i: INTEGER) is-- Put `c' at index `i'.require

valid_index(i)do

storage.put(c, i - 1)ensure

item(i) = cend

remove_last (n: INTEGER) is-- Remove `n' last characters.-- If `n' >= `count', remove all.require

n >= 0do

if (n > count) thencount := 0

elsecount := count - n

endensure

count = (0).max(old count - n)end

Automatic Documentation Extraction.

class STRING

Page 29: SmartEiffel The GNU Eiffel Compiler Tools and Libraries ... · PDF file LRDE April 22th2009 27 local integer: INTEGER list: LINKED_LIST[INTEGER] do create list.make list.add_last(1)

LRDE April 22th2009 29http://SmartEiffel.loria.fr

class STRING -- Resizable STRINGs of CHARACTERs indexed from `1` to `count`.

...

...

...

count: INTEGER-- Actual length.

capacity: INTEGER-- Capacity of the `storage` area.

invariant

count >= 0

count <= capacity

end -- of class STRING

Page 30: SmartEiffel The GNU Eiffel Compiler Tools and Libraries ... · PDF file LRDE April 22th2009 27 local integer: INTEGER list: LINKED_LIST[INTEGER] do create list.make list.add_last(1)

LRDE April 22th2009 30http://SmartEiffel.loria.fr

Now looking at the interface of class STRING using command short ... and then, the SmartEiffel web site.

Page 31: SmartEiffel The GNU Eiffel Compiler Tools and Libraries ... · PDF file LRDE April 22th2009 27 local integer: INTEGER list: LINKED_LIST[INTEGER] do create list.make list.add_last(1)

LRDE April 22th2009 31http://SmartEiffel.loria.fr

deferred class COLLECTION[E_]

ARRAY[E_]

FAST_ARRAY[E_]

RING_ARRAY[E_]

LINKED_LIST[E_]

TWO_WAY_LINKED_LIST[E_]

Assertions are written only once !

Page 32: SmartEiffel The GNU Eiffel Compiler Tools and Libraries ... · PDF file LRDE April 22th2009 27 local integer: INTEGER list: LINKED_LIST[INTEGER] do create list.make list.add_last(1)

LRDE April 22th2009 32http://SmartEiffel.loria.fr

Now looking at the interface of class COLLECTION[E].

Page 33: SmartEiffel The GNU Eiffel Compiler Tools and Libraries ... · PDF file LRDE April 22th2009 27 local integer: INTEGER list: LINKED_LIST[INTEGER] do create list.make list.add_last(1)

LRDE April 22th2009 33http://SmartEiffel.loria.fr

feature {ANY}...

Smart Tuning !

feature {}... feature {STRING}

...

Relationship between modules (i.e. who can do what.) 

feature {ARRAY, LINKED_LIST, RING_ARRAY, FAST_ARRAY}...

feature {STRING,INTEGER}... feature {COLLECTION}

...

Page 34: SmartEiffel The GNU Eiffel Compiler Tools and Libraries ... · PDF file LRDE April 22th2009 27 local integer: INTEGER list: LINKED_LIST[INTEGER] do create list.make list.add_last(1)

LRDE April 22th2009 34http://SmartEiffel.loria.fr

collection: ARRAY[STRING]

Smart Typing !

is_equal (other: like Current): BOOLEAN is...

Just change the anchor ... otherswill follows automatically.  storage: LINKED_LIST[INTEGER];

foo: like storage;

bar: like foo;

clone: like Current is...

Page 35: SmartEiffel The GNU Eiffel Compiler Tools and Libraries ... · PDF file LRDE April 22th2009 27 local integer: INTEGER list: LINKED_LIST[INTEGER] do create list.make list.add_last(1)

LRDE April 22th2009 35http://SmartEiffel.loria.fr

Now looking at the source code of class COLLECTION[E].

Page 36: SmartEiffel The GNU Eiffel Compiler Tools and Libraries ... · PDF file LRDE April 22th2009 27 local integer: INTEGER list: LINKED_LIST[INTEGER] do create list.make list.add_last(1)

LRDE April 22th2009 36http://SmartEiffel.loria.fr

Example

Documentation + Validation + Testing + Performances ! 

class DICTIONARY [V, K -> HASHABLE]­­­­ Associative memory. Values of type `V' are stored using Keys of type `K'.­­feature

...

...end ­­ DICTIONARY

Page 37: SmartEiffel The GNU Eiffel Compiler Tools and Libraries ... · PDF file LRDE April 22th2009 27 local integer: INTEGER list: LINKED_LIST[INTEGER] do create list.make list.add_last(1)

LRDE April 22th2009 37http://SmartEiffel.loria.fr

class DICTIONARY [V, K -> HASHABLE]

put (value: V; key: K) isrequire

         key /= Void      do not_yet_implemented      ensure         value = at(key)      end

has (key: K): BOOLEAN isrequire

key /= Voiddo  not_yet_implementedend

at (key: K): V isrequire

has(key)do not_yet_implementedend

add (value: V; key: K) isrequire

not has(key)do not_yet_implementedensure

count = 1 + old countvalue = at(key)

end

Page 38: SmartEiffel The GNU Eiffel Compiler Tools and Libraries ... · PDF file LRDE April 22th2009 27 local integer: INTEGER list: LINKED_LIST[INTEGER] do create list.make list.add_last(1)

LRDE April 22th2009 38http://SmartEiffel.loria.fr

class DICTIONARY [V, K -> HASHABLE]

put (value: V; key: K) isrequire

         key /= Void      do not_yet_implemented      ensure         value = at(key)      end

has (key: K): BOOLEAN isrequire

key /= Voiddo  not_yet_implementedend

at (key: K): V isrequire

has(key)do not_yet_implementedend

add (value: V; key: K) isrequire

not has(key)do not_yet_implementedensure

count = 1 + old countvalue = at(key)

end

Page 39: SmartEiffel The GNU Eiffel Compiler Tools and Libraries ... · PDF file LRDE April 22th2009 27 local integer: INTEGER list: LINKED_LIST[INTEGER] do create list.make list.add_last(1)

LRDE April 22th2009 39http://SmartEiffel.loria.fr

object.method(arg1, arg2)

How can Eiffel handles code as data ?

Ordinary valid code example used for next slides

How to make call­back ?

Page 40: SmartEiffel The GNU Eiffel Compiler Tools and Libraries ... · PDF file LRDE April 22th2009 27 local integer: INTEGER list: LINKED_LIST[INTEGER] do create list.make list.add_last(1)

LRDE April 22th2009 40http://SmartEiffel.loria.fr

code := agent object.method(?, arg2)

code.call([arg1])

­1 Capture of given operands in the agent object.

Passing missing operands and fires the method.­

Page 41: SmartEiffel The GNU Eiffel Compiler Tools and Libraries ... · PDF file LRDE April 22th2009 27 local integer: INTEGER list: LINKED_LIST[INTEGER] do create list.make list.add_last(1)

LRDE April 22th2009 41http://SmartEiffel.loria.fr

code := agent object.method(arg1, ?)

code.call([arg2])

­1 Capture of given operands in the agent object.

Passing missing operands and fires the method.­

Page 42: SmartEiffel The GNU Eiffel Compiler Tools and Libraries ... · PDF file LRDE April 22th2009 27 local integer: INTEGER list: LINKED_LIST[INTEGER] do create list.make list.add_last(1)

LRDE April 22th2009 42http://SmartEiffel.loria.fr

code := agent object.method(?, ?)

code.call([arg1, arg2])

­1 Capture of given operands in the agent object.

Passing missing operands and fires the method.­

Page 43: SmartEiffel The GNU Eiffel Compiler Tools and Libraries ... · PDF file LRDE April 22th2009 27 local integer: INTEGER list: LINKED_LIST[INTEGER] do create list.make list.add_last(1)

LRDE April 22th2009 43http://SmartEiffel.loria.fr

code := agent {TOBJECT}.method(?, ?)

code.call([object, arg1, arg2])

­1 Capture of given operands in the agent object.

Passing missing operands and fires the method.­

Page 44: SmartEiffel The GNU Eiffel Compiler Tools and Libraries ... · PDF file LRDE April 22th2009 27 local integer: INTEGER list: LINKED_LIST[INTEGER] do create list.make list.add_last(1)

LRDE April 22th2009 44http://SmartEiffel.loria.fr

code := agent object.method(arg1,arg2)

code.call([])

­

Capture of given operands in the agent object.

Passing missing operands and fires the method.

­1

Page 45: SmartEiffel The GNU Eiffel Compiler Tools and Libraries ... · PDF file LRDE April 22th2009 27 local integer: INTEGER list: LINKED_LIST[INTEGER] do create list.make list.add_last(1)

LRDE April 22th2009 45http://SmartEiffel.loria.fr

http://SmartEiffel.loria.fr

Ideal for CS teaching too.Give it a try !

Thank you for your attention.

Questions ?

Contact: [email protected]

Page 46: SmartEiffel The GNU Eiffel Compiler Tools and Libraries ... · PDF file LRDE April 22th2009 27 local integer: INTEGER list: LINKED_LIST[INTEGER] do create list.make list.add_last(1)

LRDE April 22th2009 46http://SmartEiffel.loria.fr

class POINT x, y: REAL binary ( other: POINT ) is do ... other.x ... end ...end – class POINT

CAT call example (1/3)

Page 47: SmartEiffel The GNU Eiffel Compiler Tools and Libraries ... · PDF file LRDE April 22th2009 27 local integer: INTEGER list: LINKED_LIST[INTEGER] do create list.make list.add_last(1)

LRDE April 22th2009 47http://SmartEiffel.loria.fr

class PIXEL inherit POINT redefine binary status: BOOLEAN binary ( other: PIXEL ) is do ... other.status ... end ...

CAT call example (2/3)

Page 48: SmartEiffel The GNU Eiffel Compiler Tools and Libraries ... · PDF file LRDE April 22th2009 27 local integer: INTEGER list: LINKED_LIST[INTEGER] do create list.make list.add_last(1)

LRDE April 22th2009 48http://SmartEiffel.loria.fr

local point1, point2: POINT;do point1 := create {POINT}; point2 := create {PIXEL}; point2.binary(point1) ...

Bang !

CAT call example (3/3)

Page 49: SmartEiffel The GNU Eiffel Compiler Tools and Libraries ... · PDF file LRDE April 22th2009 27 local integer: INTEGER list: LINKED_LIST[INTEGER] do create list.make list.add_last(1)

LRDE April 22th2009 49http://SmartEiffel.loria.fr

CAT call (generics Java version)

public class JavaCATcall { public static void main (String [] args) {

Integer [] integerArray = new Integer[10]; Object [] objectArray = null;

objectArray = integerArray;objectArray[1] = BANG! ;“ ”

}}

Bang !