Permalink
Browse files

document Buf.subbuf

  • Loading branch information...
1 parent 4fd9dad commit abefe1a5d3fecc15001e60ab029fcdd9d30a73ed @moritz moritz committed Aug 27, 2012
Showing with 10 additions and 0 deletions.
  1. +10 −0 lib/Buf.pod
View
@@ -37,4 +37,14 @@ Returns the number of elements of the buffer.
Applies an encoding to turn the buffer into a C<Str>.
+=head2 subbuf
+
+ method subbuf(Int $from, Int $len = self.elems) returns Buf:D
+
+Extracts a part of the invocant buffer, statrting from the index with
+elements C<$from>, and taking C<$len> elements (or less if the buffer is
+shorter), and creates a new buffer as the result.
+
+ say Buf.new(1..10).subbuf(2, 4); # Buf:0x<03 04 05 06>
+
=end pod

0 comments on commit abefe1a

Please sign in to comment.