No explicitly positive numbers!

2008-06-23 Fir de Conversatie Ben Schmidt
Hi, Bram, Another oddity I've recently discovered is that str2nr won't accept an explicitly positive number, such as '+3'. This is unexpected. Would you be willing to adjust the behaviour? I can't think of any negative/compatibility-breaking side effects this would have, but I also don't

Re: No explicitly positive numbers!

2008-06-23 Fir de Conversatie Andy Armstrong
On 23 Jun 2008, at 18:34, Gautam Iyer wrote: Doesn't that allow '+-3' ? This seems to go unnoticed in some other languages too (e.g. Python). I assume that's because they support unary '+' as an operator. It's not part of the numeric constant: print +(1+2) 3 print ++(1+2) 3

Re: No explicitly positive numbers!

2008-06-23 Fir de Conversatie Tony Mechelynck
On 23/06/08 19:28, Ben Schmidt wrote: Hi, Bram, Another oddity I've recently discovered is that str2nr won't accept an explicitly positive number, such as '+3'. This is unexpected. Would you be willing to adjust the behaviour? I can't think of any negative/compatibility-breaking side

Re: No explicitly positive numbers!

2008-06-23 Fir de Conversatie Tony Mechelynck
On 23/06/08 19:37, Andy Armstrong wrote: On 23 Jun 2008, at 18:34, Gautam Iyer wrote: Doesn't that allow '+-3' ? This seems to go unnoticed in some other languages too (e.g. Python). I assume that's because they support unary '+' as an operator. It's not part of the numeric constant:

Re: No explicitly positive numbers!

2008-06-23 Fir de Conversatie Ben Schmidt
Tony Mechelynck wrote: On 23/06/08 19:28, Ben Schmidt wrote: Hi, Bram, Another oddity I've recently discovered is that str2nr won't accept an explicitly positive number, such as '+3'. This is unexpected. Would you be willing to adjust the behaviour? I can't think of any

Re: No explicitly positive numbers!

2008-06-23 Fir de Conversatie Bram Moolenaar
Ben Schmidt wrote: Another oddity I've recently discovered is that str2nr won't accept an explicitly positive number, such as '+3'. This is unexpected. Would you be willing to adjust the behaviour? I can't think of any negative/compatibility-breaking side effects this would have, but I

Re: No explicitly positive numbers!

2008-06-23 Fir de Conversatie Ben Schmidt
Bram Moolenaar wrote: Ben Schmidt wrote: Another oddity I've recently discovered is that str2nr won't accept an explicitly positive number, such as '+3'. This is unexpected. Would you be willing to adjust the behaviour? I can't think of any negative/compatibility-breaking side effects

Re: No explicitly positive numbers!

2008-06-23 Fir de Conversatie Ben Schmidt
Ben Schmidt wrote: Bram Moolenaar wrote: Ben Schmidt wrote: Another oddity I've recently discovered is that str2nr won't accept an explicitly positive number, such as '+3'. This is unexpected. Would you be willing to adjust the behaviour? I can't think of any