6CFralb4xTPxsiXlEzGkHe changeset

Changeset303561633331 (b)
Parent343838643963 (a)
ab
0-20:49 ~/g/code/p6/t$ cat Tree/LLRB.pm6
0+21:09 ~/g/code/p6/t$ cat Tree/LLRB.pm6                                               
...
11class Tree::LLRB {
22        class Node {
33                has $.key is rw;
...
77                has $.color is rw;
88
99                method new($key, $val) {
...
10-                        $.key = $key;
10-                        $.val = $val;
10-                        # True == Red, False == Black
10-                        $.color = True;
10+                        nextwith(self, :$key, :$val, :color<True>)
...
1414                }
1515
1616                method colorFlip() {
...
8888                }
8989        }
9090}
...
91-20:49 ~/g/code/p6/t$ perl6 -e 'use Tree::LLRB; Tree::LLRB.new().insert(1, True).dump()'
91-Type objects are abstract and have no attributes, but you tried to access $!key
91-  in 'Node::new' at line 10:Tree/LLRB.pm6
91-  in 'Tree::LLRB::insert_at_node' at line 56:Tree/LLRB.pm6
91-  in 'Tree::LLRB::insert' at line 50:Tree/LLRB.pm6
91+21:09 ~/g/code/p6/t$ perl6 -e 'use Tree::LLRB; Tree::LLRB.new().insert(1, True).dump()'
91+too many positional arguments: 2 passed, 1 expected
91+  in 'Node::new' at line 1
91+  in 'Tree::LLRB::insert_at_node' at line 53:Tree/LLRB.pm6
91+  in 'Tree::LLRB::insert' at line 47:Tree/LLRB.pm6
...
9696  in main program body at line 1
9797
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
--- Revision 343838643963
+++ Revision 303561633331
@@ -1,4 +1,4 @@
-20:49 ~/g/code/p6/t$ cat Tree/LLRB.pm6
+21:09 ~/g/code/p6/t$ cat Tree/LLRB.pm6
class Tree::LLRB {
class Node {
has $.key is rw;
@@ -8,10 +8,7 @@
has $.color is rw;
method new($key, $val) {
- $.key = $key;
- $.val = $val;
- # True == Red, False == Black
- $.color = True;
+ nextwith(self, :$key, :$val, :color<True>)
}
method colorFlip() {
@@ -89,10 +86,9 @@
}
}
}
-20:49 ~/g/code/p6/t$ perl6 -e 'use Tree::LLRB; Tree::LLRB.new().insert(1, True).dump()'
-Type objects are abstract and have no attributes, but you tried to access $!key
- in 'Node::new' at line 10:Tree/LLRB.pm6
- in 'Tree::LLRB::insert_at_node' at line 56:Tree/LLRB.pm6
- in 'Tree::LLRB::insert' at line 50:Tree/LLRB.pm6
+21:09 ~/g/code/p6/t$ perl6 -e 'use Tree::LLRB; Tree::LLRB.new().insert(1, True).dump()'
+too many positional arguments: 2 passed, 1 expected
+ in 'Node::new' at line 1
+ in 'Tree::LLRB::insert_at_node' at line 53:Tree/LLRB.pm6
+ in 'Tree::LLRB::insert' at line 47:Tree/LLRB.pm6
in main program body at line 1
-