File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -83,6 +83,24 @@ and assign to the container it returned with the L<C<=>|/routine/=> operator.
83
83
All objects support methods from class L < Mu|/type/Mu > , which is the type
84
84
hierarchy root. All objects derive from C < Mu > .
85
85
86
+ Object equality needs a specific operator:
87
+ L < C < eqv > |/language/operators#infix_eqv> , the structural comparison
88
+ operator:
89
+
90
+ = for code
91
+ class Foo {
92
+ has $.bar;
93
+ has $.baz
94
+ };
95
+ my $bar = "42";
96
+ my $baz = 24;
97
+ my $zipi = Foo.new( :$baz, :$bar);
98
+ my $zape = Foo.new( :$bar, :$baz);
99
+ say $zipi eqv $zape; # OUTPUT: «True»
100
+
101
+ Object identity, on the other hand, uses C < === > . Using it above will return
102
+ C < False > , for instance.
103
+
86
104
X < |Type objects >
87
105
= head2 Type objects
88
106
You can’t perform that action at this time.
0 commit comments