Re: Feature Proposal: Allow letter decrementing
Hi,
I take a look at the code.
It does support [0-9] also.
[yohgaki@dev tests]$ php -r "\$a = ' a10';for (\$i=0; \$i<10;\$i++)
var_dump(++\$a);"
string(4) " a11"
string(4) " a12"
string(4) " a13"
string(4) " a14"
string(4) " a15"
string(4) " a16"
string(4) " a17"
string(4) " a18"
string(4) " a19"
string(4) " a20"
It sounds good to have string decrements.
2013/7/19 Peter Lind <[email protected]>
> Interesting to note that although Perl 6 is apparently capable of
> decrementing strings, it doesn't fully mirror the incrementing:
>
> http://feather.perl6.nl/syn/S03.html#line_516
>
> Specifically: decrementing 'AAA' would not turn into 'ZZ' but would error,
> according to that link
>
Carry handle of decrements is more complex than increments.
It may be the reason.
Regards,
--
Yasuo Ohgaki
[email protected]
Thread (22 messages)