Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,10 @@
deferred class
EATABLE
feature -- Basic operations
eat
-- Eat this eatable substance
deferred
end
end

View file

@ -0,0 +1,14 @@
class
APPLE
inherit
EATABLE
feature -- Basic operations
eat
-- Consume
do
print ("One apple eaten%N")
end
end

View file

@ -0,0 +1,14 @@
class
PEAR
inherit
EATABLE
feature -- Basic operations
eat
-- Consume
do
print ("One pear eaten%N")
end
end

View file

@ -0,0 +1,10 @@
class
FOOD_BOX [G -> EATABLE]
inherit
ARRAYED_LIST [G]
create
make
end

View file

@ -0,0 +1 @@
my_apple_box: FOOD_BOX [APPLE]

View file

@ -0,0 +1 @@
my_refrigerator: FOOD_BOX [EATABLE]

View file

@ -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

View file

@ -0,0 +1 @@
-- my_apple_box.extend (one_pear)