[fpc-devel] "Blank slate" next version of FPC

Henry Vermaak henry.vermaak at gmail.com
Wed Feb 20 12:32:02 CET 2019

On Wed, Feb 20, 2019 at 02:26:20PM +0300, Nikolai Zhubr wrote:
> 20.02.2019 13:21, Sven Barth via fpc-devel:
> [...]
> >And we don't agree here. For us inline variables is one of the most
> >horrid if not *the* most horrid thing Embarcadero could have done to
> >Object Pascal.
> Could you elaborate a bit about it?
> While I'm not really sure what they have done exactly (not using latest
> Delphi and probably not going to), I've somehow got very used to (and
> confortable with) Java's inline declarations, especially "for (int i = 0;
> ....)" and similar constructs, and now I find myself doing this way all the
> time, because:
> 1. it makes it easier to see the whole picture just looking at the loop
> body, no need to scroll up; (The loop body might be just 10 lines of code,
> whereas the whole containing function sometimes has 1000s)
> 2. it isoltates the scope of such variable(s), therefore preventing some
> sorts of accidental misuse outside of e.g. the containing loop (which still
> do happen to me ocasionally in Pascal).

I've already tried to make these points, nobody seems to buy it.  IIRC
Michael (vC) said that functions shouldn't be that long, so then it's
not a problem (perhaps his world is perfect, but mine certainly isn't).

I'm mostly more interested in limiting the scope to prevent accidental
use, like you.  It can also offer more fine grained control of where
managed variables get freed.


More information about the fpc-devel mailing list