nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge: nitrestful: async services and deserialize plain JSON arguments
[nit.git]
/
tests
/
example_beer.nit
diff --git
a/tests/example_beer.nit
b/tests/example_beer.nit
index
17eefbb
..
3d99198
100644
(file)
--- a/
tests/example_beer.nit
+++ b/
tests/example_beer.nit
@@
-18,9
+18,9
@@
# Just for fun
class Bottle
# Just for fun
class Bottle
- meth sing is abstract
+ fun sing is abstract
private
private
- meth sing_start
+ fun sing_start
do
printn(self, " of beer on the wall.\n")
printn(self, " of beer.\n")
do
printn(self, " of beer on the wall.\n")
printn(self, " of beer.\n")
@@
-29,14
+29,14
@@
private
end
class OneBottle
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
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
do
return "One bottle"
end
@@
-45,14
+45,14
@@
special Bottle
end
class TwoBottles
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
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
do
return "2 bottles"
end
@@
-61,15
+61,15
@@
special Bottle
end
class Bottles
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
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
do
return _quantity.to_s + " bottles"
end
@@
-79,7
+79,7
@@
special Bottle
_quantity = i
end
_quantity = i
end
- attr _quantity: Int
+ var quantity: Int
end
var i = 99
end
var i = 99