[fpc-devel] Improved RTTI compromise

Maciej Izak hnb.code at gmail.com
Wed Dec 7 11:31:43 CET 2016


2016-12-06 23:39 GMT+01:00 Sven Barth <pascaldragon at googlemail.com>:

> Most Delphi code probably uses the RTTI unit anyway for this. And when
> playing with the RTTI one needs to keep track of FPC vs. Delphi anyway
> cause we'll never be 100% compatible (e.g. the Interface RTTI branch
> does not keep in mind parameters that might be split across multiple
> locations (like two registers), so that needs to be extended compared to
> Delphi).
>

100% agree I don't have problem with a little Delphi incompatible RTTI, the
bigger picture is more important than small details, but quote from Jonas
Maebe ([fpc-devel] Attributes
 thread): "some people wanted it to be Delphi compatible, other people did
not mind if it was not. Both categories of people were in the core team."


> However I think that we'll add the Delphi compatible TAttrEntry, but
> with an additonal AttrCreate field before the AttrCtor field. The former
> will then contain a pointer to the generated "fast invoke" function
> while AttrCtor, ArgLen and ArgData will be Delphi compatible.
>

mostly redundant info, but probably best what we can get.


> Okay then, maybe I'll manage that this week (no promise though ;) ).
> I personally think that removing TRttiContext for now is the better
> choice, so people will know not to use it while they might expect valid
> values in the other case...
>

I am waiting :P. Sure, feel free to remove TRttiContext. IMO almost
empty TRttiContext has not many sense yet.


> I don't know whether an early implementation of Invoke() would be a good
> idea already as it would need a heavy rewrite once parameter location
> support is available in the RTTI...


what you mean by "heavy rewrite once parameter location"? Invoke is
extremely usefully even without detailed RTTI info about parameters, for
example for scripting purposes. I don't mean only pascal functions, script
is able to call external system API. Very handy.

-- 
Best regards,
Maciej Izak
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20161207/9ac2b1f1/attachment.html>


More information about the fpc-devel mailing list