Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

custom declarator examples in S12 don't work (nested packages) #4639

Open
p6rt opened this issue Oct 10, 2015 · 2 comments
Open

custom declarator examples in S12 don't work (nested packages) #4639

p6rt opened this issue Oct 10, 2015 · 2 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Oct 10, 2015

Migrated from rt.perl.org#126317 (status was 'new')

Searchable as RT126317$

@p6rt
Copy link
Author

p6rt commented Oct 10, 2015

From @LLFourn

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

@p6rt
Copy link
Author

p6rt commented Oct 12, 2015

From @LLFourn

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​:

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 #&#8203;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@&#8203;perl\.org

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

my module EXPORTHOW&#8203;::DECLARE \{ \}
EXPORTHOW&#8203;::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

@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant