PRADEEP GOEL said: >> > & also that any programming language must follow some sure >> mathematical >> > rules & should not get confused . >> >> The rule is "don't do that". Most languages have rules like that for >> various situations. In C, for example, a statement such as i = i++ is >> unedefined behaviour. The compiler may do what it will with that >> statement and the whole program. >> > $$$$$$$$$certainly a prog language is implemented by a > compiler/interpreter & they follow the mathematical rules , > i =i++ will too have the same behaviour for two differnt two same kind > of variales( may be arrays) > by same compiler
Maybe it will, maybe it won't. The point is that C explicitly states that with a construct such as this the behaviour is undefined. A compiler is free to do what it wants. Maybe it is consistent. Maybe it is not. Maybe it does what you think it should. Maybe it doesn't. The point is that you have broken the contract, and so all bets are off. > BRIEF /////////////////////////////////////////// > I don't think any language defines two different behaviour anywhere at > any place for > either two arrays with different no of elements nor for any two > variables of same type > at same place,same compiler ( say continuous in a program) > That's why it seems to be a BUG Perl doesn't define different behaviour for different cases of this construct. It says that the bahaviour is undefined. Now granted, Perl doesn't define these concepts as formally as C for example, partly because there is only one implementation of Perl, but when the docs say "don't do that" and you do it, I don't think you can really complain if it doesn't do what you expect. -- Paul Johnson - [EMAIL PROTECTED] http://www.pjcj.net -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]