[fpc-pascal] Can variables be declared within a block?

Michael Van Canneyt michael at freepascal.org
Mon Oct 18 16:20:07 CEST 2010



On Mon, 18 Oct 2010, Bernd Kreuss wrote:

> On 18.10.2010 15:55, Frank Church wrote:
>
>> I understand the need to avoid stuff that could create unintended errors
>
> It would create something that I would call "irregularity" (or even
> ugliness) in the language grammar. Nowhere else is it ever allowed to
> have certain things inside a begin/end block, type, const, var are all
> only allowed in the *same* certain places outside of such blocks.
> Allowing var would also raise the question why not also allow type and
> const and this would open a can of worms. It would destroy some (much)
> of the simplicity (regularity, strictness, beauty, I don't know a better
> word) of the grammar.

My thoughts exactly.

Object Pascal is a simple, beautiful and easy to read language. 
The FPC team tries to keep it that way.

If someone needs convincing that this is actually a plus: 
go and (try to) read and understand any moderately complicated perl program. 
Latex2html is a nice start :-)

Michael.



More information about the fpc-pascal mailing list