Skip to content

Commit 7d1b08a

Browse files
committed
Merge pull request #330 from gfldex/master
warn about flattening infinite lists
2 parents 4fce87f + 45dabd9 commit 7d1b08a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

doc/Type/Any.pod

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,11 @@ Examples:
136136
137137
=head2 method flat
138138
139-
Interprets the invocant as a list, flattens it, and returns that list.
139+
Interprets the invocant as a list, flattens it, and returns that list. Please
140+
note that C<.flat> will not solve the halting problem for you. If you flat
141+
an infinite list C<.flat> may return that infinite list, eating all your RAM
142+
in the process. Further, C<say> is not a good way to test lists because it will
143+
truncate after 100 elements.
140144
141145
say ((1, 2), (3)).elems; # 2
142146
say ((1, 2), (3)).flat.elems; # 3

0 commit comments

Comments
 (0)