Skip to content
Newer
Older
100644 39 lines (29 sloc) 967 Bytes
e9d014b @pmichaud Stub in Iterable and Parcel, initial infix:<,> implementation.
pmichaud authored Jun 9, 2011
1 my class Parcel is Iterable {
29921e6 @pmichaud Update comments.
pmichaud authored Jun 17, 2011
2 has $!storage; # RPA of Parcel's elements
4f8db8f @pmichaud Stub in Seq, add Parcel.list .
pmichaud authored Jun 9, 2011
3
475b15f @pmichaud First stage of refactoring List/ListIter. Defines List generation in …
pmichaud authored Jun 17, 2011
4 method flat() {
1e514a8 @pmichaud Switch pir__perl6_(list|iter)_from_rpa from functions to opcodes.
pmichaud authored Jun 17, 2011
5 pir::perl6_list_from_rpa__PPPP(List, pir::clone__PP($!storage), 1.Bool)
475b15f @pmichaud First stage of refactoring List/ListIter. Defines List generation in …
pmichaud authored Jun 17, 2011
6 }
7
4f8db8f @pmichaud Stub in Seq, add Parcel.list .
pmichaud authored Jun 9, 2011
8 method list() {
1e514a8 @pmichaud Switch pir__perl6_(list|iter)_from_rpa from functions to opcodes.
pmichaud authored Jun 17, 2011
9 pir::perl6_list_from_rpa__PPPP(List, pir::clone__PP($!storage), Mu)
475b15f @pmichaud First stage of refactoring List/ListIter. Defines List generation in …
pmichaud authored Jun 17, 2011
10 }
11
29921e6 @pmichaud Update comments.
pmichaud authored Jun 17, 2011
12 # Since Parcels are immutable, they are their own (self-reifying) iterator
4fa96ab @pmichaud Clean up Array assignment, add Parcel.iterator and List.iterator. Lis…
pmichaud authored Jun 17, 2011
13 method iterator() { self }
14 method reify($n?) { self }
15
475b15f @pmichaud First stage of refactoring List/ListIter. Defines List generation in …
pmichaud authored Jun 17, 2011
16 method perl() {
17 my Mu $rpa := pir::clone($!storage);
18 my $perl = '(';
19 $perl = $perl ~ pir::shift__PP($rpa).perl if $rpa;
20 $perl = $perl ~ ', ' ~ pir::shift__PP($rpa).perl while $rpa;
21 $perl = $perl ~ ')';
ac26106 @pmichaud Initial implementation of Array, List, and Parcel.
pmichaud authored Jun 10, 2011
22 }
23
8424798 @pmichaud Fix array assignment and transitive iteration. Add a &DUMP primitive …
pmichaud authored Jun 17, 2011
24 method DUMP() {
25 self.DUMP-ID() ~ '(:storage(' ~ DUMP($!storage) ~ '))'
26 }
e9d014b @pmichaud Stub in Iterable and Parcel, initial infix:<,> implementation.
pmichaud authored Jun 9, 2011
27 }
28
29
ac26106 @pmichaud Initial implementation of Array, List, and Parcel.
pmichaud authored Jun 10, 2011
30 my sub infix:<,>(|$) {
e9d014b @pmichaud Stub in Iterable and Parcel, initial infix:<,> implementation.
pmichaud authored Jun 9, 2011
31 pir::setattribute__0PPsP(
32 pir::repr_instance_of__PP(Parcel),
33 Parcel,
34 '$!storage',
35 pir::perl6_current_args_rpa__P());
36 }
37
38
Something went wrong with that request. Please try again.