Revision 27652
- Date:
- 2008/05/19 20:52:11
- Files:
Legend:
- Added
- Removed
- Modified
-
trunk/languages/perl6/src/classes/Hash.pir
39 39 .return ($S0) 40 40 .end 41 41 42 =item kv (method) 42 43 44 Returns elements of hash as array of C<Pair(key, value)> 45 46 =cut 47 48 .sub 'kv' :method 49 .local pmc iter 50 .local pmc rv 51 iter = new 'Iterator', self 52 rv = new 'List' 53 loop: 54 unless iter goto end 55 $S1 = shift iter 56 push rv, $S1 57 $S1 = iter[$S1] 58 push rv, $S1 59 goto loop 60 end: 61 .return (rv) 62 .end 63 64 65 43 66 .sub 'keys' :method 44 67 .local pmc iter 45 68 .local pmc rv … … 122 145 123 146 =item kv 124 147 148 =cut 149 150 .sub kv :multi('Hash') 151 .param pmc hash 152 153 .return hash.'kv'() 154 .end 155 156 125 157 =item pairs 126 158 127 159 =item values