~ubuntu-branches/ubuntu/precise/rakudo/precise

« back to all changes in this revision

Viewing changes to src/parrot/P6Invocation.pir

  • Committer: Bazaar Package Importer
  • Author(s): Ryan Niebur
  • Date: 2009-10-04 14:31:57 UTC
  • Revision ID: james.westby@ubuntu.com-20091004143157-ubq3wu0grk0f1e6a
Tags: upstream-0.1~2009.09
ImportĀ upstreamĀ versionĀ 0.1~2009.09

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
## $Id$
 
2
 
 
3
=head1 NAME
 
4
 
 
5
src/parrot/P6Invocation - extra methods for the P6Invocation PMC
 
6
 
 
7
=head2 Methods on P6Invocation
 
8
 
 
9
We also add some methods to P6Invocation.
 
10
 
 
11
=item !flatten
 
12
 
 
13
Here so that list(...) will behave nicely. No doubt can change substantially
 
14
when we have laziness support.
 
15
 
 
16
=cut
 
17
 
 
18
.namespace ["P6Invocation"]
 
19
.sub '!flatten' :method
 
20
    .local pmc result
 
21
    result = new ['ResizablePMCArray']
 
22
  it_loop:
 
23
    unless self goto it_loop_end
 
24
    $P0 = shift self
 
25
    push result, $P0
 
26
    goto it_loop
 
27
  it_loop_end:
 
28
    .return (result)
 
29
.end
 
30
 
 
31
=back
 
32
 
 
33
=cut
 
34
 
 
35
# Local Variables:
 
36
#   mode: pir
 
37
#   fill-column: 100
 
38
# End:
 
39
# vim: expandtab shiftwidth=4 ft=pir: