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

Finding out long name of module fails #3159

Closed
p6rt opened this issue Jun 6, 2013 · 4 comments
Closed

Finding out long name of module fails #3159

p6rt opened this issue Jun 6, 2013 · 4 comments

Comments

@p6rt
Copy link

p6rt commented Jun 6, 2013

Migrated from rt.perl.org#118361 (status was 'resolved')

Searchable as RT118361$

@p6rt
Copy link
Author

p6rt commented Jun 6, 2013

From @lizmat

[10​:41​:11] <lizmat> r​: module Foo { module Bar { say $?PACKAGE } } # shouldn't this need to say (Foo​::Bar) ???
[10​:41​:12] <+camelia> rakudo b2072f​: OUTPUT«(Bar)␤»
[10​:53​:53] <lizmat> TimToady​: do you have an opinion on "module Foo { module Bar { say $?PACKAGE } } # shouldn't this need to say (Foo​::Bar) ???"
[10​:54​:17] <TimToady> lizmat​: I'd think so
[10​:54​:50] <jnthn> Wait, stringifying a type object gives the short nam,e no?
[10​:55​:20] <lizmat> ah, how to get the long name then?
[10​:55​:32] <jnthn> .WHO iirc, though not sure that does the Right thing yet.
[10​:55​:54] <pmichaud> $?PACKAGE.WHO stringifies to long name
[10​:56​:13] <jnthn> Right
[10​:56​:17] <jnthn> well, *should* :)
[10​:56​:34] <lizmat> rn​: module Foo { module Bar { say $?PACKAGE.WHO } }
[10​:56​:37] <+camelia> ..rakudo b2072f​: OUTPUT«().hash␤»
[10​:56​:59] lizmat adapts rakudobug before sending off

@p6rt
Copy link
Author

p6rt commented Nov 17, 2015

From @jnthn

On Thu Jun 06 09​:00​:54 2013, elizabeth wrote​:

[10​:41​:11] <lizmat> r​: module Foo { module Bar { say $?PACKAGE }
} # shouldn't this need to say (Foo​::Bar) ???
[10​:41​:12] <+camelia> rakudo b2072f​: OUTPUT«(Bar)␤»
[10​:53​:53] <lizmat> TimToady​: do you have an opinion on "module
Foo { module Bar { say $?PACKAGE } } # shouldn't this need to say
(Foo​::Bar) ???"
[10​:54​:17] <TimToady> lizmat​: I'd think so
[10​:54​:50] <jnthn> Wait, stringifying a type object gives the
short nam,e no?
[10​:55​:20] <lizmat> ah, how to get the long name then?
[10​:55​:32] <jnthn> .WHO iirc, though not sure that does the
Right thing yet.
[10​:55​:54] <pmichaud> $?PACKAGE.WHO stringifies to long name
[10​:56​:13] <jnthn> Right
[10​:56​:17] <jnthn> well, *should* :)
[10​:56​:34] <lizmat> rn​: module Foo { module Bar { say
$?PACKAGE.WHO } }
[10​:56​:37] <+camelia> ..rakudo b2072f​: OUTPUT«().hash␤»
[10​:56​:59] lizmat adapts rakudobug before sending off

Now .WHAT reliably gists to the shortname in parens, and .WHO reliably gists to the fully qualified name. A bunch of tests were added to S10-packages/basic.t to cover this.

/jnthn

@p6rt
Copy link
Author

p6rt commented Nov 17, 2015

The RT System itself - Status changed from 'new' to 'open'

@p6rt p6rt closed this as completed Nov 17, 2015
@p6rt
Copy link
Author

p6rt commented Nov 17, 2015

@jnthn - Status changed from 'open' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant