Skip to content

Commit f151a39

Browse files
authored
Merge pull request #2464 from uzluisf/master
Wording and text reflow
2 parents dc30eee + 91c70d4 commit f151a39

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

doc/Language/containers.pod6

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -283,18 +283,21 @@ container: slurpy parameters (C<*@a>) and explicit calls to C<flat>:
283283
You can also use C<|> to create a L<Slip>, introducing a list into the other.
284284
285285
my @l := 1, 2, (3, 4, (5, 6)), [7, 8, (9, 10)];
286-
say (|@l, 11, 12); # OUTPUT: «(1 2 (3 4 (5 6)) [7 8 (9 10)] 11 12)␤»
286+
say (|@l, 11, 12); # OUTPUT: «(1 2 (3 4 (5 6)) [7 8 (9 10)] 11 12)␤»
287287
say (flat @l, 11, 12) # OUTPUT: «(1 2 3 4 5 6 7 8 (9 10) 11 12)␤»
288288
289-
In the first case, every element of C<@l> is I<slipped> as the corresponding elements of the resulting list. C<flat>, in the other hand, I<flattens> all elements including the elements of the included array, except for C«(9 10)».
289+
In the first case, every element of C<@l> is I<slipped> as the corresponding
290+
elements of the resulting list. C<flat>, in the other hand, I<flattens> all
291+
elements including the elements of the included array, except for C«(9 10)».
290292
291293
As hinted above, scalar containers prevent that flattening:
292294
293295
sub f(*@x) { @x.elems };
294296
my @a = 1, 2, 3;
295297
say f $@a, 4, 5; # OUTPUT: «3␤»
296298
297-
The C<@> character can also be used as a prefix to coerce the argument to a list, thus removing a scalar container:
299+
The C<@> character can also be used as a prefix to coerce the argument to a
300+
list, thus removing a scalar container:
298301
299302
my $x = (1, 2, 3);
300303
.say for @$x; # 3 iterations
@@ -325,8 +328,8 @@ self-referential structures.
325328
put @a.perl;
326329
# OUTPUT: «((my @Array_75093712) = [@Array_75093712,])␤»
327330
328-
Perl 6 does not prevent you from creating and using self-referential
329-
data; You may end up in a loop trying to dump the data; as a
331+
Although Perl 6 does not prevent you from creating and using self-referential
332+
data, by doing so you may end up in a loop trying to dump the data. As a
330333
last resort, you can use Promises to L<handle|/type/Promise#method_in> timeouts.
331334
332335
=head1 Type constraints
@@ -368,17 +371,19 @@ and C<%> sigiled variables gives the constraint for values:
368371
369372
=head2 Definedness constraints
370373
371-
A container can also enforce a variable to be defined. Put a smiley in the declaration:
374+
A container can also enforce a variable to be defined. Put a smiley in the
375+
declaration:
372376
373377
my Int:D $def = 3;
374-
say $def; # OUTPUT: «3␤»
378+
say $def; # OUTPUT: «3␤»
375379
$def = Int; # Typecheck failure
376380
377381
You'll also need to initialize the variable in the declaration, it can't be
378382
left undefined after all.
379383
380384
It's also possible to have this constraint enforced in all variables declared
381-
in a scope with the L<default defined variables pragma|/language/variables#Default_defined_variables_pragma>.
385+
in a scope with the
386+
L<default defined variables pragma|/language/variables#Default_defined_variables_pragma>.
382387
People coming from other languages where variables are always defined will
383388
want to have a look.
384389

0 commit comments

Comments
 (0)