Skip to content

Commit

Permalink
[setting/Any-str.pm] implemented lines($filename)
Browse files Browse the repository at this point in the history
  • Loading branch information
Carl Masak committed Mar 21, 2009
1 parent 627b6d6 commit 836900e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/classes/IO.pir
Expand Up @@ -19,7 +19,7 @@ This file implements the IO file handle class.
p6meta.'new_class'('IOIterator', 'parent'=>'Perl6Object', 'attr'=>'$!IO')

$P0 = get_hll_namespace ['IO']
'!EXPORT'('lines,readline', 'from'=>$P0)
'!EXPORT'('readline', 'from'=>$P0)
.end

=head2 Methods
Expand Down
6 changes: 6 additions & 0 deletions src/setting/Any-str.pm
Expand Up @@ -111,4 +111,10 @@ sub unpack($template, $target) {
}
}
# TODO: '$filename as Str' once support for that is in place
multi sub lines($filename) {
my $filehandle = open($filename, :r);
return lines($filehandle);
}

# vim: ft=perl6
4 changes: 4 additions & 0 deletions src/setting/IO.pm
Expand Up @@ -29,4 +29,8 @@ class IO is also {

}

multi sub lines(IO $filehandle) {
return $filehandle.lines();
}

# vim: ft=perl6

0 comments on commit 836900e

Please sign in to comment.