# New Ticket Created by  "Carl Mäsak" 
# Please include the string:  [perl #77224]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=77224 >


<masak> std: class A {}; sub A {}
<p6eval> std 31912: OUTPUT«===SORRY!===␤Illegal
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/[email protected]/msg87478.html>.)

Reply via email to