Hello. Simplified implementation of Pair.pairs. moritz++ for pointing on it.
-- Bacek
commit 71b6abede127eaa73c4ea32b00ee21150793a7f2 Author: Vasily Chekalkin <[EMAIL PROTECTED]> Date: Sat Sep 27 23:04:17 2008 +1000 Implement Pair.pairs diff --git a/languages/perl6/src/classes/Pair.pir b/languages/perl6/src/classes/Pair.pir index 2aa69b0..7535225 100644 --- a/languages/perl6/src/classes/Pair.pir +++ b/languages/perl6/src/classes/Pair.pir @@ -16,6 +16,9 @@ src/classes/Pair.pir - methods for the Pair class .local pmc p6meta p6meta = get_hll_global ['Perl6Object'], '$!P6META' p6meta.'new_class'('Perl6Pair', 'parent'=>'Any', 'attr'=>'$!key $!value', 'name'=>'Pair') + + $P0 = get_hll_namespace ['Perl6Pair'] + '!EXPORT'('pairs', $P0) .end =item key @@ -56,6 +59,16 @@ Stringify the Pair. .return ($S0) .end +=item pairs() + +Return a Pair(index, value) element for the invocant. + +=cut + +.sub 'pairs' :method + .return (self) +.end + =item perl @@ -81,7 +94,6 @@ Returns a Perl code representation of the pair. .return (result) .end - .namespace [] .sub 'infix:=>'