PageRenderTime 7ms CodeModel.GetById 2ms app.highlight 1ms RepoModel.GetById 2ms app.codeStats 0ms

/tutorial/triangle/version3/example3.e

http://github.com/tybor/Liberty
Specman e | 50 lines | 38 code | 10 blank | 2 comment | 7 complexity | 44c61d6ff0cb58eaa023ed2c0be87303 MD5 | raw file
 1class EXAMPLE3
 2   -- Let's start to copy and to compare objects... you may also run
 3   -- this example step-by-step using the Liberty Eiffel Debugger (-sedb).
 4
 5create {ANY}
 6   main
 7
 8feature {ANY}
 9   main
10      local
11         x, y, z: POINT
12      do
13         create x.make(1.0, 2.0)
14         create y.make(1.0, 2.0)
15         create z.make(3.0, 4.0)
16         if x = y then
17            io.put_string("x = y%N")
18         end
19
20         if x /= y then
21            io.put_string("x /= y%N")
22         end
23
24         if x.is_equal(y) then
25            io.put_string("x.is_equal(y)%N")
26         end
27
28         if y.is_equal(z) then
29            io.put_string("x.is_equal(y)%N")
30         end
31
32         y := x
33         if x = y then
34            io.put_string("x = y%N")
35         end
36
37         if x.is_equal(y) then
38            io.put_string("x.is_equal(y)%N")
39         end
40
41         io.put_string("To get a clone of x:%N")
42         y := x.twin
43         if x /= y and then x.is_equal(y) then
44            io.put_string("x /= y and then x.is_equal(y)%N")
45         end
46
47         sedb_breakpoint
48      end
49
50end -- class EXAMPLE3