Skip to content

Commit

Permalink
Fix List.new(1, 2, 3);
Browse files Browse the repository at this point in the history
  • Loading branch information
ashgti authored and colomon committed Jan 16, 2010
1 parent a57ebba commit 2717d0b
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/builtins/List.pir
Expand Up @@ -29,6 +29,23 @@ items are not generated until they are needed.
listproto = p6meta.'new_class'('List', 'parent'=>'Any', 'attr'=>'$!values $!gen', 'does_role'=>pos_role)
.end

=item new(*@args)

Setup initializers for built in variables.

=cut

.sub 'new' :method
.param pmc args :slurpy
.local pmc candidate, attrinit
candidate = self.'CREATE'('P6opaque')
attrinit = new ['Hash']
attrinit['values'] = args
$P0 = box 0
attrinit['gen'] = $P0
.tailcall self.'bless'(candidate, attrinit :flat :named)
.end

=item Iterator()

=cut
Expand Down

0 comments on commit 2717d0b

Please sign in to comment.