>Again, what if you assign T to a global var or a 
class member ?
>
>Why would you want to do that?
>
>You still can declare "var T: MyClass" if you plan to 
use T as a local
>reference. Obviously you only declare variables as 
automatic when you
>want to bind its lifecycle to the current procedure.

The problem actualy is not in automated destructors, 
but in that the Class
types are actually pointers in Delphi OO model. That 
IS the hack, that makes some
tasty stuff impossible (RAII) or unconvinient 
(programmer has not to forget destructor).
Just have a look at "classes" and "pointers to 
classes" in C  . The problem is that
we have no similiar functionality for first ones in 
Pascal. That what i exactly meant
in my first post.

-- 
Sergey Kosarevsky
[Linderdaum Team]
http://linderdaum.gamedot.ru
[EMAIL PROTECTED]

_______________________________________________
fpc-devel maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to