You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<masak> std: class A {}; sub A {}
<p6eval> std 31912: OUTPUT«�[31m===�[0mSORRY!�[31m===�[0mIllegal
redeclaration of routine 'A' [...] FAILED 00:01 112m»
<masak> rakudo: class A {}; sub A { say "OH HAI" }; say A.new; A()
<p6eval> rakudo 9e1bcd: OUTPUT«A()<0x6ec9d70>OH HAI»
* masak submits rakudobug
<masak> std: sub A {}; class A {}
<p6eval> std 31912: OUTPUT«ok 00:02 112m»
<jnthn> erm.
<masak> rakudo: sub A { say "OH HAI" }; class A {}; say A.new; A()
<p6eval> rakudo 9e1bcd: OUTPUT«A()<0x6ecdba0>OH HAI»
<masak> at least Rakudo is consistent. :)
<jnthn> I think Rakudo has it right there, fwiw.
<jnthn> Subs get stashed with an & sigil
<jnthn> So there's not an ambiguity.
<masak> in some sense classes and subs share the same namespace, though.
<masak> above, they're both referrable to as 'A'.
I find it curious that STD.pm6 warns in the class-then-sub case, but
not in the sub-then-class case.
Also, I'd like to hear more about the side that jnthn is representing
here, because so far all I've been hearing is that Perl 6 conflates
the namespace for classes and subroutines, and that's why only one of
them can be referred to before they're declared. (See
<http://www.mail-archive.com/perl6-all@​perl.org/msg87478.html>.)
I'm now fairly certain this is not a bug. The namespaces themselves are
not conflated (subs stored with a & sigil), and there are clear
disambiguation rules (round parens after the thing indicate the subroutine).
Migrated from rt.perl.org#77224 (status was 'resolved')
Searchable as RT77224$
The text was updated successfully, but these errors were encountered: