<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Sep 8, 2016 at 6:27 PM, David Emerson <span dir="ltr"><<a href="mailto:dle3ab@angelbase.com" target="_blank">dle3ab@angelbase.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span>On 09/08/2016 10:08 AM, silvioprog wrote:<br>
</span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span>
Hello,<br>
<br>
Looking an alternative to solve the problem I've talked at this topic<br></span>
<<a href="http://lists.freepascal.org/pipermail/fpc-pascal/2016-August/048635.html" rel="noreferrer" target="_blank">http://lists.freepascal.org/p<wbr>ipermail/fpc-pascal/2016-Augus<wbr>t/048635.html</a>>,<span><br>
I've tried to solve it declaring a macro named "TIStringComparer.Ordinal":<br>
</span></blockquote>
<br>
Macros can only replace identifiers, the dot breaks it.<br>
<br>
I would make something like,<br>
<br>
_TIStringComparer_dot_Ordinal<br>
<br>
and then you can use the definition you proposed.<br>
<br>
I'm in the habit of naming macros with a leading underscore, as I don't name anything else that way and it makes it easy to identify them.</blockquote></div><div class="gmail_extra"><br></div><div class="gmail_extra"><div class="gmail_extra">Thanks for sharing this info regarding macros. :-)</div><div class="gmail_extra"><br></div><div class="gmail_extra">I've declared a macro trying to keep the Delphi syntax, so unfortunately I can't declare it as _TIStringComparer_dot_Ordinal instead of TIStringComparer.Ordinal, hence I've temporally declared it as:</div></div><div class="gmail_extra"><br></div><div class="gmail_extra"><div class="gmail_extra">class constructor TFoo.Bar;</div><div class="gmail_extra">begin</div><div class="gmail_extra">...</div><div class="gmail_extra"> GVariables := TDictionary<string, string>.Create(</div><div class="gmail_extra">{$IFDEF FPC}</div><div class="gmail_extra">  // see <a href="http://lists.freepascal.org/pipermail/fpc-pascal/2016-August/048635.html" target="_blank">http://lists.freepascal.org/<wbr>pipermail/fpc-pascal/2016-<wbr>August/048635.html</a></div><div class="gmail_extra">  TEqualityComparer<string>.<wbr>Construct(EqualityComparison, ExtendedHasher)</div><div class="gmail_extra">{$ELSE}</div><div class="gmail_extra">  TIStringComparer.Ordinal</div><div class="gmail_extra">{$ENDIF});</div><div class="gmail_extra">end;</div></div><div class="gmail_extra"><br></div><div class="gmail_extra">but I will remove the implementation above as soon as rtl-generics allow to use TIStringComparer.Ordinal without workarounds.</div><div class="gmail_extra"><br></div>--<br><div><div dir="ltr"><div>Silvio Clécio</div></div></div>
</div></div>