Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions doc/Type/ValueObjAt.rakudoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ A subclass of L<C<ObjAt>|/type/ObjAt> that should be used to indicate that a cla
produces objects that are value types - in other words, that are immutable after
they have been initialized.

my %h = a => 42; # mutable Hash
dd %h.WHICH; # OUTPUT: «ObjAt.new("Hash|1402...888")␤»
my %h = a => 42; # mutable Hash
say %h.WHICH.raku; # OUTPUT: «ObjAt.new("Hash|2972851925856")␤»

my $date = Date.new(2025,7,20); # immutable Date
say $date.WHICH; # OUTPUT: «ValueObjAt.new("Date|60876")␤»
my $date = Date.new(2025,7,20); # immutable Date
say $date.WHICH.raku; # OUTPUT: «ValueObjAt.new("Date|60876")␤»

If you create a class that should be considered a value type, you should add
a C<WHICH> method to that class that returns a C<ValueObjAt> object, for
Expand Down