5 src/classes/Pair.pir - methods for the Pair class
13 .namespace ['Perl6Pair']
15 .sub 'onload' :anon :load :init
17 p6meta = get_hll_global ['Perl6Object'], '$!P6META'
18 p6meta.'new_class'('Perl6Pair', 'parent'=>'Any', 'attr'=>'$!key $!value', 'name'=>'Pair')
23 Gets the key of the pair.
28 $P0 = getattribute self, '$!key'
35 Gets the value of the pair.
40 $P0 = getattribute self, '$!value'
45 =item get_string() (vtable method)
51 .sub 'get_string' :method :vtable
62 Returns a Perl code representation of the pair.
71 # Get perl representation
77 result = concat '(', $S0
91 value = value.'item'()
92 $P0 = get_hll_global 'Pair'
93 .return $P0.'new'('key'=>key, 'value'=>value)
105 # vim: expandtab shiftwidth=4 ft=pir: