Skip to content

Commit

Permalink
Refactor !postcircumfix:<{ }> into Associative.pir .
Browse files Browse the repository at this point in the history
  • Loading branch information
pmichaud committed Feb 12, 2010
1 parent 0a37674 commit 0d86e31
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 26 deletions.
1 change: 0 additions & 1 deletion build/Makefile.in
Expand Up @@ -136,7 +136,6 @@ CHEATS_PIR = \
src/cheats/autoincrement.pir \
src/cheats/fail.pir \
src/cheats/object.pir \
src/cheats/postcircumfix-hash.pir \
src/cheats/int-ops.pir \
src/cheats/num-ops.pir \
src/cheats/str-ops.pir \
Expand Down
25 changes: 25 additions & 0 deletions src/builtins/Associative.pir
Expand Up @@ -75,6 +75,31 @@ Returns the type constraining what may be stored.
setprop block, "$!signature", signature
.end

=item !postcircumfix:<{ }>

Because foreign (non-Rakudo) Parrot objects generally won't
understand the "postcircumfix:<{ }>" method, we generate
postcircumfix as a private call to this function, and this
function then delegates to the appropriate method. For PMCs
that don't have a postcircumfix:<{ }> method, we'll have to
fake it later.
=cut
.namespace []
.sub '!postcircumfix:<{ }>'
.param pmc invocant
.param pmc args :slurpy
$I0 = can invocant, 'postcircumfix:<{ }>'
if $I0 goto object_method
$I0 = isa invocant, 'Mu'
if $I0 goto object_method
foreign:
die "Can't postcircumfix:<{ }> foreign objects yet."
object_method:
.tailcall invocant.'postcircumfix:<{ }>'(args :flat)
.end
=back
=cut
Expand Down
25 changes: 0 additions & 25 deletions src/cheats/postcircumfix-hash.pir

This file was deleted.

0 comments on commit 0d86e31

Please sign in to comment.