in reply to Re: $a++ allowed by $a-- is not ! why?
in thread $a++ allowed by $a-- is not ! why?
But since the sequence is a b c d e f g h i etc. why not apply magic to the -- operation and use the numbers as Base 26.
So a decrement would of ab would become:
'ab' = (1*(25*1))+(2*(25*0)) 'ab'-- = (1*(25*1))+((2*(25*0))-(1*(25*0))) = (1*(25*1))+((1*(25*0)) = 'aa'
Then 'a'-- would always = -1 and decrements become OK with a predictable behaviour.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: $a++ allowed by $a-- is not ! why?
by Anonymous Monk on Sep 02, 2003 at 19:54 UTC |