Re: [fpc-devel] Language extension: absolute for classes

2006-10-03 Thread Bram Kuijvenhoven
Micha Nelissen wrote: Marco van de Voort wrote: Changing type to something which is not a descendant (and thus incompatible) seems useless and always dangerous to me, so should be forbidden if possible. I also considered it that way. But maybe the "absolute" keyword is then a bit badly chosen,

Re: [fpc-devel] Language extension: absolute for classes

2006-10-01 Thread Micha Nelissen
peter green wrote: >>> bypassing "protected" ;) >> "protected" as in language (type) protection ? > protected as in the protected modifier for stuff in a class which is hugely > overused in the vcl. >From memory, most fields in the VCL are private, not protected. I don't think absolute will, or sh

Re: [fpc-devel] Language extension: absolute for classes

2006-10-01 Thread Michalis Kamburelis
Micha Nelissen wrote: > Michalis Kamburelis wrote: >> All you want is just to cover in class B identifier "Field" of class A. >> So you should make "Field" a dummy function in class A (that just >> returns a field value), and then you can redefine function name in >> descendant classes. See the exa

RE: [fpc-devel] Language extension: absolute for classes

2006-10-01 Thread peter green
> -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] Behalf Of Micha > Nelissen > Sent: 01 October 2006 21:41 > To: FPC developers' list > Subject: Re: [fpc-devel] Language extension: absolute for classes > > > peter green wro

Re: [fpc-devel] Language extension: absolute for classes

2006-10-01 Thread Daniël Mantione
Op Sun, 1 Oct 2006, schreef Michael Van Canneyt: > > > On Sun, 1 Oct 2006, Micha Nelissen wrote: > > > Michael Van Canneyt wrote: > > > If you do it for fields of class type only, then I think this is OK. > > > Declare the field as virtual, and require it to be 'overridden' in the > > > desce

Re: [fpc-devel] Language extension: absolute for classes

2006-10-01 Thread Michael Van Canneyt
On Sun, 1 Oct 2006, Micha Nelissen wrote: > Michael Van Canneyt wrote: > > If you do it for fields of class type only, then I think this is OK. > > Declare the field as virtual, and require it to be 'overridden' in the > > descendent class. > > Why is there a need to declare fields virtual ? B

Re: [fpc-devel] Language extension: absolute for classes

2006-10-01 Thread Micha Nelissen
peter green wrote: >> Changing type to something which is not a descendant (and thus >> incompatible) seems useless and always dangerous to me, so should be >> forbidden if possible. > useless yes, dangerous if not carefull yes but its the number one way for > bypassing "protected" ;) "protected"

RE: [fpc-devel] Language extension: absolute for classes

2006-10-01 Thread peter green
> Changing type to something which is not a descendant (and thus > incompatible) seems useless and always dangerous to me, so should be > forbidden if possible. useless yes, dangerous if not carefull yes but its the number one way for bypassing "protected" ;) _

Re: [fpc-devel] Language extension: absolute for classes

2006-10-01 Thread Micha Nelissen
Michael Van Canneyt wrote: > If you do it for fields of class type only, then I think this is OK. > Declare the field as virtual, and require it to be 'overridden' in the > descendent class. Why is there a need to declare fields virtual ? Micha ___ fpc-

Re: [fpc-devel] Language extension: absolute for classes

2006-10-01 Thread Michael Van Canneyt
On Sun, 1 Oct 2006, Micha Nelissen wrote: > Marco van de Voort wrote: > >> Changing type to something which is not a descendant (and thus > >> incompatible) seems useless and always dangerous to me, so should be > >> forbidden if possible. > > > > I also considered it that way. But maybe the "a

Re: [fpc-devel] Language extension: absolute for classes

2006-10-01 Thread Michael Van Canneyt
On Sun, 1 Oct 2006, Micha Nelissen wrote: > Michael Van Canneyt wrote: > >> is to be written in a certain format, so you tell the compiler that it > >> is like that. Why is this a hack ? > > > > Because you do a typecast just as if you would override a property using a > > read specifier and do

Re: [fpc-devel] Language extension: absolute for classes

2006-10-01 Thread Micha Nelissen
Marco van de Voort wrote: >> Changing type to something which is not a descendant (and thus >> incompatible) seems useless and always dangerous to me, so should be >> forbidden if possible. > > I also considered it that way. But maybe the "absolute" keyword is then a > bit badly chosen, since it i

Re: [fpc-devel] Language extension: absolute for classes

2006-10-01 Thread Marco van de Voort
> Marco van de Voort wrote: > >> What new syntax are you referring to ? You mean the 'absolute' ? > >> I don't think so... > > > > Depends on implementation. Do you really implement absolute as with same > > memoryspace here too, or only allow type upgrading (which is the major > > reason for suc

Re: [fpc-devel] Language extension: absolute for classes

2006-10-01 Thread Micha Nelissen
Marco van de Voort wrote: >> What new syntax are you referring to ? You mean the 'absolute' ? >> I don't think so... > > Depends on implementation. Do you really implement absolute as with same > memoryspace here too, or only allow type upgrading (which is the major > reason for such feature)? C

Re: [fpc-devel] Language extension: absolute for classes

2006-10-01 Thread Marco van de Voort
> On Sun, 1 Oct 2006, Marco van de Voort wrote: > > > > On Sun, 1 Oct 2006, Dani?l Mantione wrote: > > > > > > > > For clarity: > > > I am not opposing it, but I do consider it a dirty trick in both cases... > > > > Hmm, I don't think neli's one is that dirty, more exotic syntactic sugar. > > Y

Re: [fpc-devel] Language extension: absolute for classes

2006-10-01 Thread Micha Nelissen
Michael Van Canneyt wrote: >> is to be written in a certain format, so you tell the compiler that it >> is like that. Why is this a hack ? > > Because you do a typecast just as if you would override a property using a > read specifier and do the typecast there. Just the typecast is disguised > as

Re: [fpc-devel] Language extension: absolute for classes

2006-10-01 Thread Michael Van Canneyt
On Sun, 1 Oct 2006, Marco van de Voort wrote: > > On Sun, 1 Oct 2006, Dani?l Mantione wrote: > > > > > For clarity: > > I am not opposing it, but I do consider it a dirty trick in both cases... > > Hmm, I don't think neli's one is that dirty, more exotic syntactic sugar. > Yes it happens with

Re: [fpc-devel] Language extension: absolute for classes

2006-10-01 Thread Marco van de Voort
> On Sun, 1 Oct 2006, Dani?l Mantione wrote: > > For clarity: > I am not opposing it, but I do consider it a dirty trick in both cases... Hmm, I don't think neli's one is that dirty, more exotic syntactic sugar. Yes it happens with the composition pattern, but is it really worth inventing new sy

Re: [fpc-devel] Language extension: absolute for classes

2006-10-01 Thread Michael Van Canneyt
On Sun, 1 Oct 2006, Daniël Mantione wrote: > > > Op Sun, 1 Oct 2006, schreef Michael Van Canneyt: > > > > > > > On Sun, 1 Oct 2006, Micha Nelissen wrote: > > > > > Michalis Kamburelis wrote: > > > > All you want is just to cover in class B identifier "Field" of class A. > > > > So you shou

Re: [fpc-devel] Language extension: absolute for classes

2006-10-01 Thread Michael Van Canneyt
On Sun, 1 Oct 2006, Micha Nelissen wrote: > Michael Van Canneyt wrote: > > I don't think your solution is any cleaner than what he suggests. > > It's also a 'smart hack', after all. Just like in the old DOS days, > > Why? > > > when one would declare an array of bytes with 'absolute' at the >

Re: [fpc-devel] Language extension: absolute for classes

2006-10-01 Thread Daniël Mantione
Op Sun, 1 Oct 2006, schreef Michael Van Canneyt: > > > On Sun, 1 Oct 2006, Micha Nelissen wrote: > > > Michalis Kamburelis wrote: > > > All you want is just to cover in class B identifier "Field" of class A. > > > So you should make "Field" a dummy function in class A (that just > > > returns

Re: [fpc-devel] Language extension: absolute for classes

2006-10-01 Thread Micha Nelissen
Michael Van Canneyt wrote: > I don't think your solution is any cleaner than what he suggests. > It's also a 'smart hack', after all. Just like in the old DOS days, Why? > when one would declare an array of bytes with 'absolute' at the > location of the VGA or Hercules text screen card... Hmm?

Re: [fpc-devel] Language extension: absolute for classes

2006-10-01 Thread Michael Van Canneyt
On Sun, 1 Oct 2006, Micha Nelissen wrote: > Michalis Kamburelis wrote: > > All you want is just to cover in class B identifier "Field" of class A. > > So you should make "Field" a dummy function in class A (that just > > returns a field value), and then you can redefine function name in > > desc

Re: [fpc-devel] Language extension: absolute for classes

2006-10-01 Thread Micha Nelissen
Michalis Kamburelis wrote: > All you want is just to cover in class B identifier "Field" of class A. > So you should make "Field" a dummy function in class A (that just > returns a field value), and then you can redefine function name in > descendant classes. See the example below. Within the scope

Re: [fpc-devel] Language extension: absolute for classes

2006-10-01 Thread Michalis Kamburelis
Micah Milissent wrote: > Hi, > > I want to bring up the following scenario: (need fixed font) > >B --> G >| | >A --> F > > All are classes, and usually A 'owns' F. So A has a field 'Field' of > type F. Now, whenever A creates F, B overrides this (in virtual method > or clas

Re: [fpc-devel] Language extension: absolute for classes

2006-09-30 Thread Micha Nelissen
Marco van de Voort wrote: >> I realize that this is only a 'saving-typing' language extension, but it >> does save significant amounts of typing and would make the code more >> readable (IMHO). > > You can achieve the same with generics ? Specialize a class with =G ? No, because A needs an F, so

Re: [fpc-devel] Language extension: absolute for classes

2006-09-30 Thread Christian Iversen
On Saturday 30 September 2006 12:23, Marco van de Voort wrote: > > I realize that this is only a 'saving-typing' language extension, but it > > does save significant amounts of typing and would make the code more > > readable (IMHO). > > You can achieve the same with generics ? Specialize a class

Re: [fpc-devel] Language extension: absolute for classes

2006-09-30 Thread Marco van de Voort
> I realize that this is only a 'saving-typing' language extension, but it > does save significant amounts of typing and would make the code more > readable (IMHO). You can achieve the same with generics ? Specialize a class with =G ? ___ fpc-devel mail

[fpc-devel] Language extension: absolute for classes

2006-09-30 Thread Micha Nelissen
Hi, I want to bring up the following scenario: (need fixed font) B --> G | | A --> F All are classes, and usually A 'owns' F. So A has a field 'Field' of type F. Now, whenever A creates F, B overrides this (in virtual method or class type) to create a G. The problem now is th