Frank van Riet wrote:
Hi Patrik, Paul, Greg
Thanks very much for your comments.
...
If you have a look at my original submission you'll note that I did raise this issue, as well as a simple solution. Simply don't allow interoperability between signed and unsigned variables. This makes the impact on the compiler negligable. This has the additional benefit of forcing to programmer to think about the range of the variables.
I believe Dr. Wirth was attempting to move in the other direction, away from implementation issues and toward a conceptual representation of a number. I deduce this from the fact that the term REAL is used rather than float. A floating point representation of a real number is a more accurate description of what computers actually do, however, to focus on this aspect diverts ones thinking away from the usual task at hand of determining the value of an expression. I would like to push this avoidence of 'implementation' even farther (and perhaps in some far distant future this may happen) by completely eliminating the 'size' of a number's representation. When one uses paper and pencil and algebra to solve equations there is no consideration of implementation size. In fact the distinction between real and integer is frequently not needed. The operation of 'quantizing' a number to an integer value is sometimes necessary algebraically. If one is working with diaphatine numbers then the whole domain is strictly integer. The context of the calculation should be the determining factor. But this takes a very high level of abstraction for a machine to handle. Do you really want to 'program' or do you want to 'specify' and 'solve'. Ultimately, the later approach would be my choice. -Doug