[fpc-devel] Re: [fpc-l] type discussion

Hans-Peter Diettrich DrDiettrich at compuserve.de
Thu Jun 2 16:04:13 CEST 2005

listmember wrote:

> Inline variable initializers, such as:
> function Something(...): Boolean = False;
> var
>    Integer1: Integer = 15;
>    Boolean1: Boolean = False;
>    String1: String = 'SOME TEXT';
> begin
> end;

Such constructs are subject to frequent misinterpretation :-(

I assume that you want to have C semantics, where the variables are
initialized at every invocation of the subroutine. Other people think
that the variables are "static", retaining their values across calls
(like writeable constants).

In general I prefer an implementation of features that exist in other
Pascal compilers, over an implementation of new and incompatible
features, whose impact on the overall language (stability, type
safety...) are unpredictable.

Sometimes I dream of an compiler for both Pascal and C syntax, with
simple switching between both languages. But I would not dare to suggest
how those C parts should work, i.e. what features and bugs of which C
compiler should be implemented, and how the C code should fit together
with the Pascal code, with regards to type and operation safety.


More information about the fpc-devel mailing list