New Delphi language features since Delphi 7...
http://dn.codegear.com/article/34324


Looking at the "New language features" page I thought about two things:
1) This is one that I sometimes need: class members (static members in java
IIRC), or "class var - class property" in the page provided.
Moreover, if we had class members we could get rid of a hack in LCL that till
now couldn't be solved in other ways (the fact that LCL classes store the
WSPrivate class in the AutoTable field of the class VMT, to overcome the
lack of class members in the language).

I don't know if class members are planned/implemented in 2.3.x, is there the
will to do such a thing?


2) I don't like that "helper class" thing very much: it smells bad, and it
was introduced by Borland to map VCL classes to standard .NET ones.
However, this feature could be used to clean another (actually, it's in the
same file) big hack in lcl: the fact that class hierarchy is altered at
runtime so that tws* methods map to twsWIDGETSET* methods.
I mean, without having to overwrite VMTs, something like this could be done
(if I understood correctly the semantics of helper classes):


TWSControl = class
..
end;


and, in the interface:

TWSWin32Control = class helper for TWSControl
..
end;

No more need for "registering" an interface at runtime, since using the main
interface units causes helper classes to be used: it would be a cleaner way
using a language supported construct instead of having to hack class structure
to make things work.
This thing was introduced by Borland to map VCL to .NET: well, in LCL we are
doing the same thing - mapping lcl classes to the right widgetset - so, even
if I don't like this "helper class" thing in everyday life, in the LCL case
one could use this feature for the same reason Borland introduced it.

However, I think that this language feature would be more difficult to
implement than class members, and rarely used (it's something that only
lazarus SHOULD need - you shouldn't use it in your programs).

bye,
Giulio
_________________________________________________________________
    To unsubscribe: mail [EMAIL PROTECTED] with
               "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to