<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2017-09-01 11:41 GMT+02:00 Stefan Glienke <span dir="ltr"><<a href="mailto:sglienke@dsharp.org" target="_blank">sglienke@dsharp.org</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Again you will cause unnecessary headaches because now your helper has the dependency of the builtin and the third party one.<br>
How would third party one and third party two implement them? They both probably would extend the builtin one. Which one can you use in your code then?<br>
Yes, the one that comes last in the uses. What if you want to use functions from both? Out of luck again.<br>
<br>
Inheritance regardless what form is never is the best option here. I think "ancestor list" is just a misnomer in the documentation as it cannot be a list but only one in case of class helper.</blockquote><div><br></div><div>The control of modules order in uses section can turn programmers life into real hell for type helpers. I think that new directive $EXPLICITHELPERS should help :</div><div><br></div><div>type</div><div><div>  TH1 = record helper for string</div><div>    procedure foo;</div><div>    procedure foo1;</div><div>  end;</div></div><div><div><br></div><div><div>  TH2 = record helper for string</div><div>    procedure foo;</div><div>    procedure foo2;</div><div>  end;<br></div></div></div><div><div><br></div><div>  TH3 = record helper for string</div><div>    procedure foo;</div><div>    procedure foo3;</div><div>  end;<br></div></div><div><br></div><div>var</div><div>  s: string;</div><div>begin<br></div><div>  s.foo; // call TH3.foo</div><div><br></div><div>{$EXPLICITHELPERS TH1 for string} // scope for helpers limited only to TH1</div><div>  s.foo; // call TH1.foo</div><div>  s.foo3; // error</div><div><div><br></div><div>{$EXPLICITHELPERS TH2, TH1 for string}</div></div><div>  s.foo; // call TH2.foo</div><div>  s.foo1; // call TH1.foo1</div><div><br></div><div><div>{$EXPLICITHELPERS default for string}</div></div><div>  s.foo; // call TH3.foo</div><div>  </div><div><div>{$EXPLICITHELPERS TH1, default for string} </div></div><div>  s.foo; // TH1.foo</div><div>  s.foo1;</div><div>  s.foo2;</div><div>  s.foo3;</div><div>end.<br></div><div><br></div><div>-- <br></div></div><div class="gmail_signature"><div dir="ltr"><div>Best regards,<br>Maciej Izak</div></div></div>
</div></div>