TSS Chapter #15 Examples in Oz %%%%%%%%%%%%%%%%%%% The Little Schemer - Chapter - 15 %%%%%%%%%%%%%%%%%%%%%% % 15.1 X = {NewCell chicago|pizza|nil} % 15.3 {Browse 3#(X := gone)} % 15.6 {Browse 6#(X := skins)} % 15.9 fun {Gourmet Food} Food|@X|nil end local Y in Y = onion {Browse 9#{Gourmet Y}} end % 15.13 X := rings % 15.14 local Y in Y = onion {Browse 14#{Gourmet Y}} end % 15.17 fun {Gourmand Food} X := Food Food|@X|nil end % 15.21 {Browse 21#{Gourmand potato}} % 15.27 local W in W = rice {Browse 27#{Gourmand W}} end % 15.30 fun {Diner Food} milkshake|Food|nil end fun {DinerR Food} X := Food milkshake|Food|nil end % 15.31 {Browse 31#{DinerR onion}} % 15.32 {Browse 32#@X} % 15.33 {Browse 31#{DinerR pecanpie}} % 15.34 {Browse 34#@X} % 15.36 {Browse 36#{Gourmand onion}} % 15.46 local X = {NewCell minestrone} in fun {Omnivore Food} X := Food Food|@X|nil end end % 15.60 local Z in Z = bouillabaise {Browse 60#{Omnivore Z}} end % 15.71 local X = {NewCell minestrone} in fun {Gobbler Food} X := Food Food|@X|nil end end % 15.78 local Z in Z = gumbo {Browse 60#{Gobbler Z}} end % 15.85 fun {Nibbler Food} X = {NewCell donut} in X := Food Food|@X|nil end % 15.86 {Browse 86#{Nibbler cheerio}} % 15.96 Food = {NewCell none} fun {Glutton X} Food := X more|X|more|X|nil end % 15.98 {Browse 98#{Glutton garlic}} % 15.99 {Browse 99#@Food} % 15.100 {Browse 100#@X} % 15.106 proc {ChezNous} Food := @X X := @Food end % 15.107 {Browse 107#@Food} % 15.108 {Browse 108#@X} % 15.109 {ChezNous} % 15.110 {Browse 110#@Food} % 15.111 {Browse 111#@X} % 15.118 proc {ChezNous_1} A = @Food in Food := @X X := A end % 15.119 {Browse 119#{Glutton garlic}} % 15.120 {Browse 120#@Food} % 15.121 {Browse 121#{Gourmand potato}} % 15.122 {Browse 122#@X} % 15.123 {ChezNous_1} % 15.124 {Browse 124#@Food} % 15.125 {Browse 125#@X} |