Skip to content

Commit

Permalink
Update to try to enable array slices... seems to have a dispatch
Browse files Browse the repository at this point in the history
issue that I think I need jnthn++ to look at.
  • Loading branch information
pmichaud committed Feb 13, 2010
1 parent a3054f5 commit 74c008c
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/builtins/Positional.pir
Expand Up @@ -101,24 +101,22 @@ src/classes/Positional.pir - Positional Role
.param pmc args :slurpy
.param pmc options :slurpy :named
.local pmc result
args = 'list'(args)
args = '&eager'(args)
$I0 = elements args
if $I0 == 1 goto arg_slice
result = new ['List']
result = new ['Parcel']
args_loop:
unless args goto args_done
$P0 = shift args
$P0 = 'postcircumfix:<[ ]>'(self, $P0, options :named :flat)
$P0 = 'list'($P0)
$I0 = elements result
splice result, $P0, $I0, 0
$P0 = '!postcircumfix:<[ ]>'(self, $P0, options :named :flat)
push result, $P0
goto args_loop
args_done:
.return (result)
arg_slice:
$P0 = args[0]
.const 'Sub' $P1 = 'Positional::postcircumfix:[Int]'
.tailcall $P1(self, $P0, options :named :flat)
.tailcall self.$P1($P0, options :named :flat)
.end

.sub '' :load :init
Expand Down

0 comments on commit 74c008c

Please sign in to comment.