On Fri, May 24, 2019 at 5:46 PM J. Gareth Moreton <[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

Reply via email to