Skip Menu |
Report information
Id: 126317
Status: new
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: lloyd.fourn [at] gmail.com
Cc:
AdminCc:

Severity: (no value)
Tag: Bug
Platform: (no value)
Patch Status: (no value)
VM: (no value)



Date: Sat, 10 Oct 2015 23:40:20 +1100
From: Lloyd Fournier <lloyd.fourn [...] gmail.com>
To: rakudobug [...] perl.org
Subject: [BUG] custom declarator examples in S12 don't work (nested packages)
http://design.perl6.org/S12.html#Custom_Meta-objects

    my module EXPORTHOW::DECLARE { }
    EXPORTHOW::DECLARE<controller> = ControllerHOW;
This currently throws "cannot modify an immuteable EXPORTHOW::DECLARE". But if we fix that there is another problem:
my package EXPORTHOW::DECLARE { 
    OUR::<controller> := Metamodel::ClassHOW;
};
doesn't work either. The thing that works is:
my package EXPORTHOW {
    package DECLARE {
        OUR::<controller> := Metamodel::ClassHOW;
   }
}
Not sure if the docs are wrong or the implementation though the following problem seems linked:
package Foo { package Bar { our sub foo {} }}; 
package Foo::Bar { our sub bar {} };
say Foo::Bar::<&foo>.package; #-> (Bar)
say Foo::Bar::<&bar>.package; #-> (Foo::Bar)
But if you then try in a new interpreter:
package Foo { package Bar { our sub foo {} }}; 
package Foo::Bar { our sub bar {} }; 
#!> Redeclaration of routine foo (already defined in package Foo::Bar)
TL;DR rakudo is not sure which namespace nested packages belong to




To: perl6-bugs-followup [...] perl.org
From: Lloyd Fournier <lloyd.fourn [...] gmail.com>
Date: Sat, 10 Oct 2015 23:42:55 +1100
Subject: Re: [perl #126317] AutoReply: [BUG] custom declarator examples in S12 don't work (nested packages)
I made a pasta error. The final example should be:

package Foo { package Bar { our sub foo {} }};
package Foo::Bar { our sub foo {} };
#!> Redeclaration of routine foo (already defined in package Foo::Bar)

On Sat, Oct 10, 2015 at 11:41 PM, perl6 via RT <perl6-bugs-followup@perl.org> wrote:
Show quoted text
Greetings,

This message has been automatically generated in response to the
creation of a trouble ticket regarding:
        "[BUG] custom declarator examples in S12 don't work (nested packages)",
a summary of which appears below.

There is no need to reply to this message right now.  Your ticket has been
assigned an ID of [perl #126317].

Please include the string:

         [perl #126317]

in the subject line of all future correspondence about this issue. To do so,
you may reply to this message.

                        Thank you,
                        perl6-bugs-followup@perl.org

-------------------------------------------------------------------------
http://design.perl6.org/S12.html#Custom_Meta-objects

    my module EXPORTHOW::DECLARE { }
    EXPORTHOW::DECLARE<controller> = ControllerHOW;

This currently throws "cannot modify an immuteable
EXPORTHOW::DECLARE". But if we fix that there is another problem:

my package EXPORTHOW::DECLARE {
    OUR::<controller> := Metamodel::ClassHOW;
};

doesn't work either. The thing that works is:

my package EXPORTHOW {
    package DECLARE {
        OUR::<controller> := Metamodel::ClassHOW;
   }
}

Not sure if the docs are wrong or the implementation though the
following problem seems linked:

package Foo { package Bar { our sub foo {} }};
package Foo::Bar { our sub bar {} };
say Foo::Bar::<&foo>.package; #-> (Bar)
say Foo::Bar::<&bar>.package; #-> (Foo::Bar)

But if you then try in a new interpreter:

package Foo { package Bar { our sub foo {} }};
package Foo::Bar { our sub bar {} };
#!> Redeclaration of routine foo (already defined in package Foo::Bar)

TL;DR rakudo is not sure which namespace nested packages belong to




This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org