[fpc-devel] Pointer cache for fast class/pointer access.

Marcos Douglas md at delfire.net
Thu Jan 5 19:50:03 CET 2012


On Thu, Jan 5, 2012 at 8:03 AM, Hans-Peter Diettrich
<DrDiettrich1 at aol.com> wrote:
> Marcos Douglas schrieb:
>
>
>>> I don't see any reason why the Object type should be dropped. It's close
>>> to C++ objects, useful in porting code. It allows for static objects,
>>> e.g. in the stack, while TObject is bound to the heap (without tricks).
>>
>>
>> So, Object types is indicated only for compatibility?
>> In your opinion, for the atual code, we have some benefit using Object
>> (stack) instead Class (heap)?
>
>
> Delphi (now) provides Records with methods, but these lack inheritance. Why
> introduce such a crippled construct, when Objects can do the same and more
> (virtual methods...).

+1
But more about Object type, what do you think to use Object to group
routines instead of using procedure/functions, as a 'namespace' to not
use the unit name as a prefix?

Anyone else?

>>> I used Object types to e.g. emulate C bitfields, with a simple typecast
>>> of a
>>> variable into the according object...
>>
>>
>> What is bitfields?
>
>
> C bitfields are parts of some integral type variable, with each field
> spanning one or more bits. They allow to e.g. subdivide DWORD parameters,
> which consist of several parts (combined with OR).

Thanks for clarification.

Marcos Douglas



More information about the fpc-devel mailing list