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

Make .ver and .auth MetaModel methods available on Packages #818

Merged
merged 1 commit into from Jul 8, 2016
Merged

Make .ver and .auth MetaModel methods available on Packages #818

merged 1 commit into from Jul 8, 2016

Conversation

zoffixznet
Copy link
Contributor

@zoffixznet zoffixznet commented Jul 8, 2016

Fixes RT#128579

Tests: Raku/roast#134

This adds .^ver and .^auth methods to packages, fixing this:

$ perl6 -e 'my class Z:ver<1.2.3>:auth<me> {}; say [ Z.^ver(), Z.^auth ];'
[v1.2.3 me]
$ perl6 -e 'my module Z:ver<1.2.3>:auth<me> {}; say [ Z.^ver(), Z.^auth ];'
[v1.2.3 me]
$ perl6 -e 'my package Z:ver<1.2.3>:auth<me> {}; say [ Z.^ver(), Z.^auth ];'
Method 'ver' not found for invocant of class 'Perl6::Metamodel::PackageHOW'
  in block <unit> at -e line 1

$ 

Relevant IRC Conversation: http://irclog.perlgeek.de/perl6/2016-07-08#i_12808945

@moritz moritz merged commit ae36a14 into rakudo:nom Jul 8, 2016
@zoffixznet zoffixznet deleted the fix-RT128579-package-verf branch July 8, 2016 19:34
@jnthn
Copy link
Member

jnthn commented Jul 8, 2016

Um, this wasn't an oversight, it was intentional. Not supporting auth/ver is one of the things that distinguishes a package from a module. Packages play the role of being replaceable stubs. For example:

jnthn@lviv:~/dev/rakudo$ ./perl6-m -e 'package A { }; package A { }'
jnthn@lviv:~/dev/rakudo$ ./perl6-m -e 'package A { }; module A { }'
jnthn@lviv:~/dev/rakudo$ ./perl6-m -e 'module A { }; module A { }'
===SORRY!=== Error while compiling -e
Redeclaration of symbol A
at -e:1
------> module A { }; module A⏏ { }

Notice how the first two are fine, only the last one is an error. Attaching identify to something that we've defined as freely replaceable feels odd. So, I'm inclined to revert this.

@lizmat
Copy link
Contributor

lizmat commented Jul 8, 2016

FWIW, I'm inclined to agree.

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

Successfully merging this pull request may close these issues.

None yet

4 participants