develooper Front page | perl.perl6.users | Postings from February 2021

Weird! When legal?

Thread Next
From:
rir
Date:
February 24, 2021 16:41
Subject:
Weird! When legal?
Message ID:
20210224164028.uzeryvea4gkpeyq6@localhost
Hello,

> class samesame { hello samesame { say "Wosup?" } }

===SORRY!=== Error while compiling:
Unexpected block in infix position (missing statement control word before the expression?)
------> class samesame { hello samesame⏏ { say "Wosup?" } }
    expecting any of:
        infix
        infix stopper
        postfix

Why is this a special case instead of a common undeclared error?  The
second 'samesame' could be 'Instant' and do the same.
I'm not seeing how to continue from the ⏏  to make a statement.


rir


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About