Skip to content

Commit

Permalink
Move .end() from builtins (PIR) into setting (P6).
Browse files Browse the repository at this point in the history
Demonstrated at YAPC::EU 2009 presentation.
  • Loading branch information
pmichaud committed Aug 9, 2009
1 parent f489207 commit 4786eb8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 18 deletions.
18 changes: 0 additions & 18 deletions src/builtins/any-list.pir
Expand Up @@ -18,12 +18,6 @@ the size of that file down and to emphasize their generic,

=cut

.namespace ['Any']
.sub 'onload' :anon :init :load
$P0 = get_hll_namespace ['Any']
'!EXPORT'('end', 'from'=>$P0)
.end

=item elems()

=cut
Expand All @@ -42,18 +36,6 @@ the size of that file down and to emphasize their generic,
.return ($I0)
.end

=item end

=cut

.namespace ['Any']
.sub 'end' :method :multi(_)
.local pmc list
list = self.'list'()
$I0 = list.'elems'()
dec $I0
.return ($I0)
.end

=item keys()

Expand Down
2 changes: 2 additions & 0 deletions src/setting/Any-list.pm
@@ -1,4 +1,6 @@
class Any is also {
multi method end() is export { $.list.elems - 1; }

multi method first(Code $test) {
return $_ if $test($_) for @.list;

Expand Down

0 comments on commit 4786eb8

Please sign in to comment.