Constrained genericity: Difference between revisions

Content added Content deleted
No edit summary
Line 384: Line 384:


:class Eatable
:class Eatable
:m eat ;m
:m eat cr ." successful eat" ;m
;class
;class


\ FoodBox is defined without using eat in any way.
\ FoodBox objects are created without using eat in any way.
:class FoodBox
:class FoodBox
object-list eatable-types
object-list eatable-types
Line 397: Line 397:
:m test:
:m test:
begin eatable-types each:
begin eatable-types each:
while eat cr ." successful eat"
while eat
repeat ;m
repeat ;m
;class
;class
Line 425: Line 425:
successful eat
successful eat
</lang>
</lang>



=={{header|Go}}==
=={{header|Go}}==