in reply to Re: $a++ allowed by $a-- is not ! why?
in thread $a++ allowed by $a-- is not ! why?

This node falls below the community's minimum standard of quality and will not be displayed.
  • Comment on Re: Re: $a++ allowed by $a-- is not ! why?

Replies are listed 'Best First'.
Re: Re: Re: $a++ allowed by $a-- is not ! why?
by demerphq (Chancellor) on Aug 30, 2003 at 20:34 UTC

    Considering that broquaint had nothing to do with the decision, and was merely adding info to the thread I think your tone is a touch out of line.

    Can you explain why undef is superior to foo or even a fatal error?

    I imagine that the reason it was left out was not so much that the answer was indeterminate, but rather in order to avoid countless numbers of users bitching about it not working they way they expect. Better to leave it out on the grounds that to do anything else would just end up wasting more time than it ever could have saved.

    Incidentally if you think this is a good behaviour you are of course perfectly entitled to create your own class and use overload to provide it.


    ---
    demerphq

    <Elian> And I do take a kind of perverse pleasure in having an OO assembly language...
      If I could have put any tone into the words it would be one of curiosity and respect. Judging from the votes there are more people who read a lot that was not written. Back to topic. Not implementing $foo-- as the inverse of $foo++ must have had serious reasons. The undeterminedness of the predecessor does not seem to qualify, because the meaning of undef is a lot closer to 'this string has no predecessor' than 'die' or '-1' (or foo). So there must have been more to it. What? Until now it's just guess and assume - and I can do no better.
        If I could have put any tone into the words it would be one of curiosity and respect.
        You called broquaint a name. You called him your Holiness. That is tone, sarcastic, even insulting. If you wish to be inquisitive, simply ask questions without saying/implying anything about the poster (especially something insulting/uninvited).

        Back to the topic, Larry Wall created perl. The perl5-porters fix bugs and may know many of the reasons why things work the way they do (although a lot of them are really busy fixing bugs). I see monks asking why all the time, and some monks have good reasons, others are just curious, but they all eventually have to accept that they will never fully/really know. The reasons behind some things are easily explained (obvious), the reasons behind others are document, and for the rest they're simply not important (as long as it's documented how it works, the why doesn't matter).