# New Ticket Created by "Brian S. Julin" # Please include the string: [perl #64858] # in the subject line of all future correspondence about this issue. # <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=64858 >
prefix:<=> has been summarily executed.
>From 49abde08f49bb6b3b3a201bc8599fcb093549102 Mon Sep 17 00:00:00 2001 From: root <r...@charon.clarku.edu> Date: Sun, 19 Apr 2009 15:04:17 -0400 Subject: [PATCH] Add .get to Iterator. Also added name=>Iterator to class constructor --- src/classes/Iterator.pir | 23 ++++++++++++++++++++++- 1 files changed, 22 insertions(+), 1 deletions(-) diff --git a/src/classes/Iterator.pir b/src/classes/Iterator.pir index eed4fae..aca7f38 100644 --- a/src/classes/Iterator.pir +++ b/src/classes/Iterator.pir @@ -17,8 +17,29 @@ Iterator - Perl 6 iterator .sub 'onload' :anon :init :load .local pmc p6meta, iterproto p6meta = get_hll_global ['Perl6Object'], '$!P6META' - iterproto = p6meta.'new_class'('Perl6Iterator', 'parent'=>'Any') + iterproto = p6meta.'new_class'('Perl6Iterator', 'parent'=>'Any', 'name'=>'Iterator') p6meta.'register'('Iterator', 'parent'=>iterproto, 'protoobject'=>iterproto) + + $P0 = get_hll_namespace ['Perl6Iterator'] + '!EXPORT'('get', 'from'=>$P0, 'to_p6_multi'=>1) +.end + +=head2 Methods + +=over + +=item get + +Returns the value at the current position in the Iterator and +prepares the Iterator to read the next value the next time +C<get> is invoked on it. + +=cut + +.namespace ['Perl6Iterator'] +.sub 'get' :method + $P0 = shift self + .return ($P0) .end =back -- 1.6.2.2