# New Ticket Created by "Carl Mäsak" # Please include the string: [perl #67846] # in the subject line of all future correspondence about this issue. # <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=67846 >
<masak> rakudo: sub foo(:$bar) { say $bar }; class A { has $.bar; method baz() { foo(:$.bar) } }; A.new(:bar<OH HAI>).baz <p6eval> rakudo b19862: OUTPUT«Symbol '$1bar' not predeclared in baz [...] <masak> :) * masak submits rakudobug <masak> now, are my expectations right in this case? could the above code print "OH HAI"? <Matt-W> masak: I don't know if your expectations are correct <Matt-W> Is :$.bar supposed to be like :bar($.bar) <masak> aye. <masak> that was my expectation. <moritz_> I don't think so <Matt-W> Because I wouldn't expect so without reading it somewhere <moritz_> because $.bar is not parsed as a variable, but as a method call <masak> moritz_: does that matter? <moritz_> it does matter, Perl 6 is all about syntax <masak> and what about :$!bar, then? <Matt-W> I would expect the same behaviour as $.bar <Matt-W> whatever that happens to be... <masak> rakudo: sub foo(:$bar) { say $bar }; class A { has $!bar; method baz() { foo(:$!bar) } }; A.new(:bar<OH HAI>).baz <p6eval> rakudo b19862: OUTPUT«Symbol '$1bar' not predeclared in baz [...] <masak> I still think Rakudo does the Wrong thing here. <moritz_> $1bar? <masak> there's no $1bar variable. <masak> right. <moritz_> that's a less-than-awesome error message <Matt-W> At the very least <moritz_> (hint, hint) <masak> yes, it alone merits a bug report. <masak> moritz_: I'm writing it now. you're in it! :) <Matt-W> It's either a Missing Feature or a less-than-awesome error message <Matt-W> the question is which <masak> Matt-W: exactly. <moritz_> well, the table in S06 for named arguments doesn't list it, I think <masak> I see no reason why it shouldn't work. <masak> same with $^placeholder variables, I'd say. <Matt-W> I see no reason why it should <moritz_> convenience would a good reason, no? <Matt-W> Mmm <masak> I think so. <Matt-W> I can seen an argument for it <masak> consistency, too. <moritz_> Perl 6 is all about convenience; otherwise we'd still be writing assembler code ;-) <masak> it's not like the syntax is being used for something else.