Skip to content

Commit

Permalink
Make !EXPORT able to handle converting multis to Perl6MultiSub as it …
Browse files Browse the repository at this point in the history
…exports them, to save sprinking calls to !TOPERL6MULTISUB all over the code base and to make sure we export the multi in its Perl 6 dispatch algorithm form.
  • Loading branch information
jnthn committed Apr 8, 2009
1 parent 776152d commit ccc12b3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/builtins/guts.pir
Expand Up @@ -23,6 +23,7 @@ it understands how to properly merge C<MultiSub> PMCs.
.param pmc from :named('from')
.param pmc to :named('to') :optional
.param int has_to :opt_flag
.param int to_p6_multi :named('to_p6_multi') :optional

if has_to goto have_to
to = get_hll_namespace
Expand All @@ -38,6 +39,11 @@ it understands how to properly merge C<MultiSub> PMCs.
value = from[symbol]
$I0 = isa value, 'MultiSub'
unless $I0 goto store_value
if to_p6_multi != 1 goto no_convert
$P0 = value[0]
'!TOPERL6MULTISUB'($P0)
value = from[symbol]
no_convert:
$P0 = to[symbol]
if null $P0 goto store_value
$I0 = isa $P0, 'MultiSub'
Expand Down

0 comments on commit ccc12b3

Please sign in to comment.