X-Git-Url: http://nitlanguage.org diff --git a/tests/example_beer.nit b/tests/example_beer.nit index 17eefbb..3d99198 100644 --- a/tests/example_beer.nit +++ b/tests/example_beer.nit @@ -18,9 +18,9 @@ # Just for fun class Bottle - meth sing is abstract + fun sing is abstract private - meth sing_start + fun sing_start do printn(self, " of beer on the wall.\n") printn(self, " of beer.\n") @@ -29,14 +29,14 @@ private end class OneBottle -special Bottle - redef meth sing + super Bottle + redef fun sing do sing_start printn("No more bottles of appear on the wall!\n\n") end - redef meth to_s: String + redef fun to_s: String do return "One bottle" end @@ -45,14 +45,14 @@ special Bottle end class TwoBottles -special Bottle - redef meth sing + super Bottle + redef fun sing do sing_start printn("One bottle appears on the wall\n\n") end - redef meth to_s: String + redef fun to_s: String do return "2 bottles" end @@ -61,15 +61,15 @@ special Bottle end class Bottles -special Bottle + super Bottle - redef meth sing + redef fun sing do sing_start printn(_quantity - 1," bottles appear on the wall!\n\n") end - redef meth to_s: String + redef fun to_s: String do return _quantity.to_s + " bottles" end @@ -79,7 +79,7 @@ special Bottle _quantity = i end - attr _quantity: Int + var quantity: Int end var i = 99