Posts tagged ‘RTTI’

Closing the documentation gap

This morning on StackOverflow, someone asked a question about invoking constructors through extended RTTI. It happened that I’d had to work out a way to do that a couple weeks ago, and it took me about 5 minutes to find the code, strip out a few specific details and type up a solution.  I got an accepted response, a few upvotes, and a very interesting comment from the author:

Continue reading ‘Closing the documentation gap’ »

TValue is very slow!

Delphi 2010’s help describes TValue, used by the RTTI unit to store values of arbitrary types, as “a lightweight version of the Variant type.” I saw that and it made me wonder, how lightweight is it? How fast is using TValue?

Thankfully, among D2010’s lesser-known new features is the Diagnostics unit, which gives us TStopwatch, a simple record for timing operations. That makes it very easy to write a simple speed test.
Continue reading ‘TValue is very slow!’ »

Under the hood of an anonymous method

I woke up this morning and checked DelphiFeeds, and found a very interesting post by Jolyon Smith about the use of the absolute keyword.  That reminded me that I had to go and write up this article.  Why?  Because it’s the only way I know of to get inside an anonymous method’s functor object and do some looking around.

Continue reading ‘Under the hood of an anonymous method’ »