nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge: Intro `Task` and use in for Android's `run_on_ui_thread`
[nit.git]
/
tests
/
example_point.nit
diff --git
a/tests/example_point.nit
b/tests/example_point.nit
index
39738d7
..
a7b89ea
100644
(file)
--- a/
tests/example_point.nit
+++ b/
tests/example_point.nit
@@
-16,27
+16,8
@@
class Point
private
class Point
private
- var _x: Int # Abscisse
- var _y: Int # Ordonnée
-
-
- fun x: Int
- do
- return _x
- end
- fun x=(i: Int)
- do
- _x = i
- end
-
- fun y: Int
- do
- return _y
- end
- fun y=(i: Int)
- do
- _y = i
- end
+ var x: Int = 0 # Abscisse
+ var y: Int = 0 # Ordonnée
# Change la position d'un point
fun moveto(x: Int, y: Int)
# Change la position d'un point
fun moveto(x: Int, y: Int)
@@
-53,15
+34,10
@@
private
redef fun ==(p)
do
redef fun ==(p)
do
- return not p is null and p isa Point and _x == p.x and _y == p.y
+ return p isa Point and _x == p.x and _y == p.y
end
end
- init
- do
- moveto(0, 0)
- end
-
init at(x: Int, y: Int)
do
moveto(x, y)
init at(x: Int, y: Int)
do
moveto(x, y)