On Tue, 10 Jan 2012 02:16:07 -0800, masak wrote:
> <tadzik> about wrap again: https://gist.github.com/1585730
>
> Included here for completeness:
>
> ┌─[tadzik@yavin4]─[~/src/perl/bailador] (master)*
> └─[%]─> cat lib/Bailador.pm
> module Bailador;
>
> our sub our_template {
> return "(our template)"
> }
>
> sub exp_template is export {
> return "(exp template)"
> }
>
> sub hook is export {
> &our_template.wrap: { "wrapped {callsame()}" };
> &exp_template.wrap: { "wrapped {callsame()}" };
> }
> ┌─[tadzik@yavin4]─[~/src/perl/bailador] (master)*
> └─[%]─> cat examples/app.pl
> use Bailador;
>
> sub foo {
> say Bailador::our_template();
> say exp_template();
> }
>
> hook();
>
> foo();
> ┌─[tadzik@yavin4]─[~/src/perl/bailador] (master)*
> └─[%]─> perl6 examples/app.pl
> wrapped (our template)
> (exp template)
This bug is still present in current Rakudo:
This is Rakudo version 2017.08-104-g76f1d8970
built on MoarVM version 2017.08.1-148-g1059eed1
implementing Perl 6.c.
(Test script now needs s/module/unit module/ to run, but then produces the same
result.)
Calling `&exp_template.WHICH` also confirms that the one in the module and the
one in the mainline scope are different objects.