Skip to content

Commit

Permalink
Document .words and .ins
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim Smith committed Aug 27, 2015
1 parent 33dc2ec commit 889e20a
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions lib/Type/IO/Handle.pod
Expand Up @@ -43,6 +43,18 @@ Return a lazy list of the file's lines read via L<get>, limited to C<$limit> lin
@data.push($line.split(','))
}
=head2 method words
method words($count = Inf)
Return a lazy list of the file's words (separated on whitespace), limited
to C<$count> words.
=for code :allow<B>
my %dict;
++%dict{$_} for $*IN.words;
say "Most common words: ", %dict.sort(*.value).reverse.[^5];
=head2 method print
method print(*@text --> Bool)
Expand Down Expand Up @@ -92,6 +104,12 @@ The end of the file.
Return the current position of the file pointer in bytes.
=head2 method ins
method ins(IO::Handle:D: --> Int)
Return the number of lines read from the file.
=head2 method slurp-rest
multi method slurp-rest(IO::Handle:D: :$bin! --> Buf)
Expand Down

0 comments on commit 889e20a

Please sign in to comment.