Re: RFE: throw an error on a single "="when used in an "if"

2017-03-18 Thread Elizabeth Mattijsen
(This time to the list) > On 18 Mar 2017, at 10:19, ToddAndMargo wrote: > Request for Enhancement: > > Would you consider throwing a compiler error on the following: > > perl6 -e 'my $x=2;my $y=3; if $x = $y {say "yes";} else {say "no";}’ > yes FWIW, I don’t think that

Re: RFE: throw an error on a single "="when used in an "if"

2017-03-18 Thread JuhiMarcel LangbroekTimmerman
Hi, This is the same behaviour you can find in perl5 and is not a flaw. It is an assignment just before testing. So $x gets the value of $y and then test which becomes True. This can also be very covenient when e.g calling a sub, then assign to a value then test like below in a while;

RFE: throw an error on a single "="when used in an "if"

2017-03-18 Thread ToddAndMargo
Dear Perl 6 Developers, Request for Enhancement: Would you consider throwing a compiler error on the following: perl6 -e 'my $x=2;my $y=3; if $x = $y {say "yes";} else {say "no";}' yes It should have two == signs if it is followed by a {do something} This is the correct way: $ perl6 -e 'my