Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,10 @@
|
|||
deferred class
|
||||
EATABLE
|
||||
|
||||
feature -- Basic operations
|
||||
|
||||
eat
|
||||
-- Eat this eatable substance
|
||||
deferred
|
||||
end
|
||||
end
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
class
|
||||
APPLE
|
||||
|
||||
inherit
|
||||
EATABLE
|
||||
|
||||
feature -- Basic operations
|
||||
|
||||
eat
|
||||
-- Consume
|
||||
do
|
||||
print ("One apple eaten%N")
|
||||
end
|
||||
end
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
class
|
||||
PEAR
|
||||
|
||||
inherit
|
||||
EATABLE
|
||||
|
||||
feature -- Basic operations
|
||||
|
||||
eat
|
||||
-- Consume
|
||||
do
|
||||
print ("One pear eaten%N")
|
||||
end
|
||||
end
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
class
|
||||
FOOD_BOX [G -> EATABLE]
|
||||
|
||||
inherit
|
||||
ARRAYED_LIST [G]
|
||||
|
||||
create
|
||||
make
|
||||
|
||||
end
|
||||
|
|
@ -0,0 +1 @@
|
|||
my_apple_box: FOOD_BOX [APPLE]
|
||||
|
|
@ -0,0 +1 @@
|
|||
my_refrigerator: FOOD_BOX [EATABLE]
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
class
|
||||
APPLICATION
|
||||
|
||||
create
|
||||
make
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
make
|
||||
-- Run application.
|
||||
do
|
||||
create my_apple_box.make (10)
|
||||
create one_apple
|
||||
create one_pear
|
||||
my_apple_box.extend (one_apple)
|
||||
-- my_apple_box.extend (one_pear)
|
||||
across
|
||||
my_apple_box as ic
|
||||
loop
|
||||
ic.item.eat
|
||||
end
|
||||
end
|
||||
|
||||
feature -- Access
|
||||
|
||||
my_apple_box: FOOD_BOX [APPLE]
|
||||
-- My apple box
|
||||
|
||||
one_apple: APPLE
|
||||
-- An apple
|
||||
|
||||
one_pear: PEAR
|
||||
-- A pear
|
||||
end
|
||||
|
|
@ -0,0 +1 @@
|
|||
-- my_apple_box.extend (one_pear)
|
||||
Loading…
Add table
Add a link
Reference in a new issue