// example 8 <' type size_t : [small, medium, large]; type color_t : [yellow, red, blue]; struct window { // All windows must have some response to a mouse click. The specific response: a sound, a change in color etc, // will be determined in the specific(inherited) windows. This method is defined as "empty"- the specific // windows will provide the appropriate implementation draw() is empty; // All windows must draw something on the screen. The specific graphics of // each window will be determined in the specific (inherited) windows. This // method is defined as "empty" and the specific windows will fill in the details }; struct my_window like window { // "size" and "background_color" are also fields of the inherited class "my_window" since they are // fields of the base class "window" therefore I can constrain them here. keep size == big; keep background color == blue; // "when_mouse_is_clicked" is defined in the base class since every window // has to do something when it is clicked. However, what is it that it should do exactly is different // from window to window. Mine, for example, sounds a bip, and then shows a pop up message. when_mouse_is_clicked() is { sound_a_bip(); jump_a_pop_up("Come on and milk my cow"); }; // same for "draw" draw() is { draw_caw(); draw_milk_bottle(); }; }; struct her_window like window { keep size == small; keep background color == blue; when_mouse_is_clicked() is also { sound_a_wof(); jump_a_pop_up("Come on and bite my dog"); }; draw() is also { draw_dog(); }; }; '>