Hello fpc-devel-admin,
fdadetn> Send fpc-devel mailing list submissions to fdadetn>
fdadetn> To subscribe or unsubscribe via the web, visit fdadetn> http://lists.freepascal.org/mailman/listinfo/fpc-devel fdadetn> or, via email, send a message with subject or body 'help' to fdadetn>
fdadetn> You can reach the person managing the list at fdadetn>
fdadetn> When replying, please edit your Subject line so it is more specific than fdadetn> "Re: Contents of fpc-devel digest..."
fdadetn> Today's Topics:
fdadetn> 1. A question about old style objects (Pavel V. Ozerski) fdadetn> 2. Re: A question about old style objects (Peter Vreman)
fdadetn> --__--__--
fdadetn> Message: 1
fdadetn> To:
fdadetn> Organization: Sechenov Institute of Evolutionary Physiology and fdadetn> Biochemistry, Russian Academy of Science
fdadetn> From: (Pavel V. Ozerski)
fdadetn> Date: Mon, 29 Oct 2001 11:31:08 +0300 (MSK) fdadetn> Subject: [fpc-devel]A question about old style objects fdadetn> Reply-To:
fdadetn> Hello all,
fdadetn> I found in Russian-language forum (FPC community) a question about possibility to use RTTI with fdadetn> BP-style objects. First my idea was to answer "no" but I made a smallest test:
fdadetn> {$ifdef FPC}
fdadetn> {$smartlink on}
fdadetn> {$typeinfo off}
fdadetn> {$endif}
fdadetn> type
fdadetn> t1=object
fdadetn> constructor Create;
fdadetn> procedure Test;virtual;
fdadetn> end;
fdadetn> t2=object(t1)
fdadetn> procedure Test;virtual;
fdadetn> end;
fdadetn> constructor t1.Create;
fdadetn> begin
fdadetn> end;
fdadetn> procedure t1.Test;
fdadetn> begin
fdadetn> writeln('11111111111111111111111111');
fdadetn> end;
fdadetn> procedure t2.Test;
fdadetn> begin
fdadetn> writeln('22222222222222222222222222');
fdadetn> end;
fdadetn> type
fdadetn> p2=^t2;
fdadetn> var
fdadetn> t:^t1;
fdadetn> begin
fdadetn> t:=new(p2,create);
fdadetn> t^.Test;
fdadetn> end.fdadetn> I became very surprised when I looked into created .exe file and found in it 11111111111111111111111111 string. fdadetn> BP7, Delphi 3, Delphi 6 cutted unused t1.test method out from .exe, FPC 1.1 (and also VP 2.1) kept it in .exe. fdadetn> What is the mean, to keep unused BP-objects methods in .exe although old objects are not designed for RTTI? fdadetn> Or FPC does support RTTI for these objects? Then, IMHO, it is a unnecessary feature because then old-style fdadetn> objects will be useless (but in Borland products they are useful because allow to write compact high-optimized fdadetn> applications; a good demonstration is KOL - free Key Object Library for Delphi).
fdadetn> Sincerely, Pavel
fdadetn> --__--__--
fdadetn> Message: 2
fdadetn> To:
fdadetn> From: Peter Vreman
fdadetn> Subject: Re: [fpc-devel]A question about old style objects fdadetn> Date: Mon, 29 Oct 2001 08:56:36 GMT
fdadetn> Reply-To:
> Hello all, > I found in Russian-language forum (FPC community) a question about possibility to use
fdadetn> RTTI
fdadetn> with
Show quoted text 35 lines
fdadetn> 11111111111111111111111111 string.
> BP7, Delphi 3, Delphi 6 cutted unused t1.test method out from .exe, FPC 1.1 (and also VP
fdadetn> 2.1) kept it in .exe.
> What is the mean, to keep unused BP-objects methods in .exe although old objects are not
fdadetn> designed for RTTI?
> Or FPC does support RTTI for these objects? Then, IMHO, it is a unnecessary feature
fdadetn> because then old-style
> objects will be useless (but in Borland products they are useful because allow to write
fdadetn> compact high-optimized
> applications; a good demonstration is KOL - free Key Object Library for Delphi).
fdadetn> The VMT of t2 contains a reference to the VMT of t1. And that one contains a reference to fdadetn> t1.Test.
fdadetn> I don't know an easy solution to remove this kind of unused code. And IMHO it has a very fdadetn> low priority to be solved.
And why not to add RTTI to standart objects ? (or function, to let just know the exact object type by pointer to it ?)
