<div dir="ltr">Hi,<div><br></div><div>I think that the most acceptable solution for all in core team and for advanced users (here I mean Stefan Glienke ;) ) for smart pointers and nullable types is usage of default property without indexer.</div><div><br></div><div>For example : </div><div><br></div><div>type</div><div> TFoo = record</div><div> { ... }</div><div> property Some: Integer read GetSome write SetSome; default; </div><div> end;</div><div><br></div><div>this solution seems better compromise than default field (which I personally prefer). This will allows new proper handling of exceptions for nullable types, IIRC this was mentioned by Stefan Glienke as the main disadvantage of default fields, also probably all Jonas Maebe doubts are not actual with "default property without indexers" (for example "var" parameter problem for overloaded procedures).</div><div><br></div><div>
<div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">usage of smart pointers and nullable types will introduce more extensive usage of managed types (finally every nullable type and smart pointer is in managed types category because "default property without indexers" almost always means usage of management operators) which may means really slowdown, but this can be solved (generally already is solved in my FastRTTI branch) - in this context is worth to look into my other topic : </div></div><div><br></div><div>"[fpc-devel] Attn Sven: New flags related to management operators" ( <a href="http://lists.freepascal.org/pipermail/fpc-devel/2018-June/039109.html">http://lists.freepascal.org/pipermail/fpc-devel/2018-June/039109.html</a> )</div><div><br></div><div>also might be worth to introduce modeswitch to allows "default field" which should be disabled by default for all modes. In practice default field is also very usable in many scenarios, for example as replacement for type helpers or as some kind of aspects and many more.</div><div><br></div><div>the main questions are :</div><div><br></div><div>* FastRTTI should be introduced into NewPascal only or should be refactored and used also in FPC trunk?</div><div>* What with TRecordInfoInitFlags? <span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">(very important for above, with FastRTTI
<span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">TRecordInfoInitFlags</span> has not much sense)</span></div><div><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">* What with smart pointers/nullable types/ARC objects further work? Here the same question : NewPascal only or FPC trunk too?</span></div><div><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></div><div>-- <br></div><div><div class="gmail_signature"><div dir="ltr"><div>Best regards,<br>Maciej Izak</div></div></div>
</div></div>