Re: namespace
- Posted by Jiri Babor <jbabor at PARADISE.NET.NZ> Jul 09, 2002
- 426 views
Hi, Derek! You wrote: >I believe that RDS is considering issuing a warning whenever a declaration >overrides another one. However, which behaviour are you upset over - the >missing warning or the overriding? > >I would like the overide functionality to continue. But I wonder if, when we >get the warning message facility, the programmer could code something like >... > > override constant a = 2 > >This would do two things: Skip the message being issued and alert the reader >of the code to the fact that the override is deliberate. I must admit I do not see your point in having this sort of 'functionality'. If the 'constant' is no longer a constant, make it into a variable and simply re-assign it. The behaviour is also inconsistent: for instance we are not allowed to override user defined routines, where it would be, often, very useful. >Another point, Jiri. The style of coding you demonstrate above, seems to say >that you knew that 'a' had been declared in test.e (thus the first "? a" >command). You then declare another 'a', knowing that the first one existed. >The problem for a code reader is then - is this second declaration a mistake >or deliberate? Sorry, Derek, that was just an illustration, simplified. In actual case I am currently updating a large application with a number of cascading includes, cutting and pasting, also using several versions. It just happened I had the same constants (flags) declared at different levels with slightly different values - and it took me two days to trace the bug... jiri