Skip to content

Commit

Permalink
Fix a link and elaborate on Slip.new versus prefix:<|>, add slip()
Browse files Browse the repository at this point in the history
  • Loading branch information
skids committed Jan 18, 2016
1 parent 03c2f46 commit a70059b
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions doc/Language/list.pod
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ to an C<@>-sigiled variable.
@s[4]; # Says 42 two more times
You may also use the C<.cache> method instead of C<.list>, depending
on how you want the references handled. See the C<page on C<Seq>|/type/Seq>
on how you want the references handled. See the L<page on C<Seq>|/type/Seq>
for details.
=comment TODO document .iterator
Expand All @@ -105,12 +105,17 @@ for details.
Sometimes you want to insert the elements of a list into another list.
This can be done with a special type of sequence called a C<Slip>.
say (1,(2,3),4) eqv (1,2,3,4) # says False
say (1,Slip.new(2,3),4) eqv (1,2,3,4) # says True
say (1,(2,3),4) eqv (1,2,3,4); # says False
say (1,Slip.new(2,3),4) eqv (1,2,3,4); # says True
say (1,slip(2,3),4) eqv (1,2,3,4); # also says True
Another way to make a slip is with the C<|> prefix operator:
Another way to make a C<Slip> is with the C<|> prefix operator. Note that
this has a tighter precedence than the comma, so it only affects a single
value, but unlike the above options, it will break L<Scalars|/type/Scalar>.
say (1,|(2,3),4) eqv (1,2,3,4) # says True
say (1,|(2,3),4) eqv (1,2,3,4); # says True
say (1,|$(2,3),4) eqv (1,2,3,4); # also says True
say (1,slip($(2,3)),4) eqv (1,2,3,4); # says False
=head1 Immutability
Expand Down

0 comments on commit a70059b

Please sign in to comment.