-
-
Notifications
You must be signed in to change notification settings - Fork 373
/
Iterable.pir
50 lines (35 loc) · 973 Bytes
/
Iterable.pir
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
=head1 TITLE
Iterable - Perl 6 Iterable Role
=head1 DESCRIPTION
Iterable is the role for objects that can produce
iterators and flatten in list contexts.
XXX: This file implements Iterable as a class
for the time being, because Pm was tired of struggling
with making it into a role. Eventually it should
be made into a role, and the classes that are defined
as "is Iterable" should be come "does Iterable".
=head2 Methods
=over 4
=cut
.namespace ['Iterable']
.sub 'onload' :anon :init :load
.local pmc p6meta, proto
p6meta = get_hll_global ['Mu'], '$!P6META'
proto = p6meta.'new_class'('Iterable', 'parent'=>'Cool')
.end
.namespace ['Iterable']
.sub 'item' :method
x_enter_sublog
$P0 = descalarref self
$P0 = new ['ObjectRef'], $P0
$P1 = get_hll_global 'True'
setprop $P0, 'scalar', $P1
.return ($P0)
.end
=back
=cut
# Local Variables:
# mode: pir
# fill-column: 100
# End:
# vim: expandtab shiftwidth=4 ft=pir: