"Prof A Olowofoyeku (The African Chief)" wrote:
On 15 Dec 2003 at 9:16, Peter N Lewis wrote:
What possible reason could there be for suppressing it? The only use I can see for such a statement is to discard the return value from a function named ParamCount that has side effects, and that is much more clearly done with: "junk := ParamCount;"
I always wanted the extended syntax
nil := ParamCount;
to get the benefits of being able to throw away the return value with the clarity that you are doing so and without the necessity to create junk variables.
Precisely. However, such an extension would then mean loss of compatibility with other Pascal compilers. I think I will just suppress the warning.
IIRC the original complaint, since snipped, applied to BP and attempted to use a null statement after a conditional. It seems to me that there is absolutely no need for such a statement in BP, since ParamCount begins life there as a global variable, and it would probably not be good form to redefine it.
As far as an extended throw-away syntax is concerned, I have seen far too many C failures due to ignoring a return value (especially malloc/realloc, but including fclose, printf, etc) than is comfortable, and I see no need to encourage such bad C habits in Pascal.