[fpc-devel] indexed property with default value for param?

Daniël Mantione daniel.mantione at freepascal.org
Thu Jun 11 16:29:13 CEST 2009



Op Thu, 11 Jun 2009, schreef Michael Van Canneyt:

> On Thu, 11 Jun 2009, Jonas Maebe wrote:
>
>> 
> I would think it is a natural extension of procedural overloading ?

It's not that simple. Properties can be both hidden variable access as 
well as procedure access. Variable overloading is not allowed, 
because it causes a lot of issues, i.e.:

var a:word;
     a:char;

begin
   a:=1;
   a:='!';
   writeln(a); {what does this mean??}
end;


Property overloading gets you the same issues, i.e. in the example above 
you could replace both variables with properties and answer the same 
question.

Considering this, I do not think it can considered a logical extension of 
procedure overloading.

Daniël


More information about the fpc-devel mailing list