Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[src/builtins/guts.pir] arrays/hashes & handles
Removed the special treatment of array/hash attributes with 'handles'
traits. These now behave as any other attribute, as per spec change
r28846.
  • Loading branch information
Carl Masak committed Oct 20, 2009
1 parent 9d76f3b commit f5b38a0
Showing 1 changed file with 1 addition and 19 deletions.
20 changes: 1 addition & 19 deletions src/builtins/guts.pir
Expand Up @@ -798,12 +798,9 @@ and C<type>.
# For the handles trait verb, we may have got a name or a list of names.
# If so, just generate methods with those names. Otherwise, need to store
# them as a property on the metaclass, so the dispatcher can smart-match
# against them later. Also, the % syntax is spec'd as reserved, so we give
# an error on that for now.
# against them later.
.const 'Sub' handles = '!handles'
.local pmc handles_it
$S0 = substr name, 0, 1
if $S0 == '%' goto reserved_syntax_error
$I0 = isa $P0, 'Str'
if $I0 goto simple_handles
$I0 = isa $P0, 'List'
Expand Down Expand Up @@ -848,8 +845,6 @@ and C<type>.
goto handles_loop
handles_done:
.return ()
reserved_syntax_error:
'die'("The use of a %hash with the handles trait verb is reserved")
.end


Expand All @@ -865,19 +860,6 @@ and C<type>.
attribute = getattribute self, attrname
$P1 = getprop 'methodname', method
$S1 = $P1
$S0 = substr attrname, 0, 1
if $S0 != '@' goto single_dispatch
.local pmc it
it = iter attribute
it_loop:
unless it goto it_loop_end
$P0 = shift it
$I0 = $P0.'can'($S1)
unless $I0 goto it_loop
.tailcall $P0.$S1(args :flat, options :flat :named)
it_loop_end:
'die'("You used handles on attribute ", attrname, ", but nothing in the array can do method ", $S1)
single_dispatch:
.tailcall attribute.$S1(args :flat, options :flat :named)
.end

Expand Down

0 comments on commit f5b38a0

Please sign in to comment.