Skip to content

Commit 7ec81b2

Browse files
committed
Buf.reallocate example improved.
Show that the buffer can be enlarged.
1 parent 1dc88f2 commit 7ec81b2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

doc/Type/Buf.pod6

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ returns the altered C<Buf>.
7171
$b.reallocate(5);
7272
say $b.perl; # OUTPUT: «Buf.new(0,1,2,3,4)␤»
7373
74+
$b = Buf.new( 1..3 );
75+
$b.reallocate( 10 );
76+
$b.perl.say; # OUTPUT: «Buf.new(1,2,3,0,0,0,0,0,0,0)␤»
77+
7478
=head2 method push
7579
7680
method push( $elems )

0 commit comments

Comments
 (0)