err now that I actually check with warnings it seems I'm wrong and "" " "
both give the same warning.

perl -E 'use warnings; use strict; say 1 + ""'
Argument "" isn't numeric in addition (+) at -e line 1.
1
perl -E 'use warnings; use strict; say 1 + " "'
Argument " " isn't numeric in addition (+) at -e line 1.
1

me bad.

On Wed, Jul 6, 2016 at 2:22 AM Lloyd Fournier <lloyd.fo...@gmail.com> wrote:

> I think this is to be consistent with p5.
> perl -E 'say "" + 1' #-> 1
>
> I'm not really making an argument it should be this way. But that's
> probably the reason.
>
> On Wed, Jul 6, 2016 at 2:13 AM Zefram <perl6-bugs-follo...@perl.org>
> wrote:
>
>> # New Ticket Created by  Zefram
>> # Please include the string:  [perl #128543]
>> # in the subject line of all future correspondence about this issue.
>> # <URL: https://rt.perl.org/Ticket/Display.html?id=128543 >
>>
>>
>> Is it permitted to have no digits at all when coercing a Str to Int?
>> The behaviour is inconsistent:
>>
>> > "".Int
>> 0
>> > " ".Int
>> Cannot coerce NaN to an Int
>>   in block <unit> at <unknown file> line 1
>>
>> Observing that spaces are permitted when there are digits, it would
>> seem that for consistency spaces should also make no difference to the
>> treatment of an otherwise-empty string.
>>
>> -zefram
>>
>

Reply via email to