<div>I just did, the real case just saved me to do about 10.000 lines of code in a very tedious job.</div><div> </div><div>Became like this:</div><div> </div><div>unit Unit1;</div><div>{$mode objfpc}{$M+}</div><div>interface</div>
<div>uses<br> Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls;</div><div>type</div><div> { TTeste }</div><div> TTeste = class<br> published<br> procedure Proc;<br> end;</div><div>type</div>
<div> { TForm1 }</div><div> TForm1 = class(TForm)<br> Button1: TButton;<br> procedure Button1Click(Sender: TObject);<br> private<br> { private declarations }<br> public<br> { public declarations }<br> end;</div>
<div>var<br> Form1: TForm1;</div><div>type<br> TProc = procedure of object;</div><div>implementation</div><div>procedure DoProc(Sender: TObject);<br>var<br> M : TMethod;<br> P: TProc;<br>begin<br> M.Data := Pointer(Sender) ;<br>
M.Code := Sender.MethodAddress('Proc') ;<br> P := TProc(M);<br> P;<br>end;</div><div>{ TTeste }</div><div>procedure TTeste.Proc;<br>begin<br> ShowMessage('oi');<br>end;</div><div>{$R *.lfm}</div><div>
{ TForm1 }</div><div>procedure TForm1.Button1Click(Sender: TObject);<br>begin<br> DoProc(TTeste.Create);<br>end;</div><div>end.<br><br></div><div class="gmail_quote">2012/3/27 Michael Van Canneyt <span dir="ltr"><<a href="mailto:michael@freepascal.org">michael@freepascal.org</a>></span><br>
<blockquote style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid" class="gmail_quote"><div class="im"><br>
<br>
On Tue, 27 Mar 2012, Marco van de Voort wrote:<br>
<br>
</div><div class="im"><blockquote style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid" class="gmail_quote">
On Tue, Mar 27, 2012 at 09:00:07PM +0200, Michael Van Canneyt wrote:<br>
<blockquote style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid" class="gmail_quote"><blockquote style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid" class="gmail_quote">
<br>
2010 actually. And since this list has been _very_ sensitive about bloat<br>
recently, I would not even dare to suggest that way ;-)<br>
</blockquote>
<br>
I would.<br>
<br>
Under command of some switch, of course, it surely would come in handy.<br>
<br>
The rtti unit they made for it is of course totally convoluted, but the idea<br>
to be able to use introspection on all aspects of a class is definitely useful<br>
and would make RPC frameworks a breeze.<br>
</blockquote>
<br>
That's roughly my opinion too, after a short read-up during D2010 times.<br>
Never enable it globally only for certain classes in frameworks that benefit<br>
from it. Haven't really used it yet though.<br>
</blockquote>
<br></div>
Well, I am using it - I'm exposing a JSON RPC through it.<br>
<br>
The 'only for certain classes' is my point of view as well.<br>
<br>
It would only be necessary for the classes that get exposed as data, and the interfaces.<span class="HOEnZb"><font color="#888888"><br>
<br>
Michael.</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
--<br>
______________________________<u></u>_________________<br>
Lazarus mailing list<br>
<a href="mailto:Lazarus@lists.lazarus.freepascal.org" target="_blank">Lazarus@lists.lazarus.<u></u>freepascal.org</a><br>
<a href="http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus" target="_blank">http://lists.lazarus.<u></u>freepascal.org/mailman/<u></u>listinfo/lazarus</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Everton Vieira.<br>