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

2009-06-11 Thread Michael Van Canneyt
On Wed, 10 Jun 2009, Martin wrote: Procedures/Functions can have default values for arguments, so they don't need to be specified if called function GetFoo(Bar: integer; XY: Boolean = True): Integer; Properties (indexed) don't have such a syntax: property Foo[Bar: integer; XY: Boolean =

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

2009-06-11 Thread Martin Friebe
Michael Van Canneyt wrote: On Wed, 10 Jun 2009, Martin wrote: However the follwing Syntax compiles fine: function GetFoo(Bar: integer; XY: Boolean = True): Integer; property Foo[Bar: integer; XY: Boolean] read GetFoo; a := Object.Foo[1]; But: Is that supposed to work? No, it is not. It is a

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

2009-06-11 Thread Jonas Maebe
On 11 Jun 2009, at 14:14, Martin Friebe wrote: However it would be nice to have a feature like property Foo[Index: Integer]: Integer write SetFoo read GetFoo; property Foo[Index: Integer; Ask: Boolean]: Integer write SetFooAsk read GetFooAsk; The must have different Method Names,

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

2009-06-11 Thread Michael Van Canneyt
On Thu, 11 Jun 2009, Jonas Maebe wrote: On 11 Jun 2009, at 14:14, Martin Friebe wrote: However it would be nice to have a feature like property Foo[Index: Integer]: Integer write SetFoo read GetFoo; property Foo[Index: Integer; Ask: Boolean]: Integer write SetFooAsk read GetFooAsk;

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

2009-06-11 Thread Jonas Maebe
On 11 Jun 2009, at 14:44, Michael Van Canneyt wrote: On Thu, 11 Jun 2009, Jonas Maebe wrote: On 11 Jun 2009, at 14:14, Martin Friebe wrote: However it would be nice to have a feature like property Foo[Index: Integer]: Integer write SetFoo read GetFoo; property Foo[Index: Integer; Ask:

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

2009-06-11 Thread Michael Van Canneyt
On Thu, 11 Jun 2009, Jonas Maebe wrote: On 11 Jun 2009, at 14:44, Michael Van Canneyt wrote: On Thu, 11 Jun 2009, Jonas Maebe wrote: On 11 Jun 2009, at 14:14, Martin Friebe wrote: However it would be nice to have a feature like property Foo[Index: Integer]: Integer write SetFoo read

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

2009-06-11 Thread Daniël Mantione
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

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

2009-06-11 Thread Michael Van Canneyt
On Thu, 11 Jun 2009, Daniël Mantione wrote: 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

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

2009-06-11 Thread Martin Friebe
Daniël Mantione wrote: 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

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

2009-06-10 Thread Martin
Procedures/Functions can have default values for arguments, so they don't need to be specified if called function GetFoo(Bar: integer; XY: Boolean = True): Integer; Properties (indexed) don't have such a syntax: property Foo[Bar: integer; XY: Boolean = True] read GetFoo; will give an error