I personally disagree with that one because it's just fluff, considering
that "nothing" is equivalent to "{ nothing }" - usually a keyword or an
intrinsic should actually do something.
Gareth aka. Kit
On 27/05/2019 02:33, Ben Grasset wrote:
On Fri, May 24, 2019 at 5:46 PM J. Gareth Moreton
<[email protected] <mailto:[email protected]>> wrote:
Whenever I come across a section of code in my own projects where
"*else *;" is necessary, or any empty branch for that matter, I
put a "{ Do nothing }" comment just to make it absolutely clear
that the block is there deliberately and so there isn't any
confusion with the syntax on first viewing; e.g:
On a more general scale, it seems like it might be a reasonable spot
for an actual new case-block-specific keyword? I can't imagine it
would be an insurmountable task to do something like make the literal
word "nothing" (followed by a semicolon) act as "sugar" in the context
of case blocks for what a lone semicolon normally does.
For example:
type TSomeEnum = (A, B, C, D);
case BlahBlah() of
A: DoThingForA();
B: DoThingForB();
C: nothing;
D: DoThingForD();
end;
_______________________________________________
fpc-devel maillist - [email protected]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus
_______________________________________________
fpc-devel maillist - [email protected]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel