Skip to content

Commit

Permalink
Refactor List.new a bit; set 'flatten' flag so that lists created
Browse files Browse the repository at this point in the history
this way still flatten in list context.
  • Loading branch information
pmichaud committed Jan 21, 2010
1 parent ee71f1e commit 57a8065
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/builtins/List.pir
Expand Up @@ -37,13 +37,11 @@ Setup initializers for built in variables.

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

=item Iterator()
Expand Down

0 comments on commit 57a8065

Please sign in to comment.