Skip to content

Commit 43ac7e2

Browse files
committed
Change the wording on self-referential structures
It's fine, you can use them. Closes #1125
1 parent 9cdecdf commit 43ac7e2

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

doc/Language/containers.pod6

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -273,18 +273,20 @@ Methods generally don't care whether their invocant is in a scalar, so
273273
274274
maps over a list of three elements, not of one.
275275
276-
=head1 Self Reference
276+
=head1 Self-Referential Data
277277
278-
Complex containers, like Array or Hash and relatives, can contain a reference
279-
to itself, forming recursive data structures. Please note that very few builtin
280-
functions and methods will detect infinite loops. It is the responsibility of the
281-
user to L<handle|/type/Promise#method_in> timeouts.
278+
Containers types, including C<Array> and C<Hash>, allow you to create
279+
self-referential structures.
282280
283281
my @a;
284282
@a[0] = @a;
285283
put @a.perl;
286284
# OUTPUT: «((my @Array_75093712) = [@Array_75093712,])␤»
287285
286+
Perl 6 does not prevent you from creating and using self-referential
287+
data; You may end up in a loop trying to dump the data; as a
288+
last resort, you can use Promises to L<handle|/type/Promise#method_in> timeouts.
289+
288290
=head1 Type Constraints
289291
290292
Any container can have a type constraint in the form of

0 commit comments

Comments
 (0)