<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Fair enough. Thanks Sven. It just seemed to be a bit of an
anomaly in my eyes. (The ambiguity shouldn't be an issue because
of the semicolon following directives)</p>
<p>Just something I thought I'd bring up.</p>
<p>Gareth aka. Kit</p>
<p><br>
</p>
<div class="moz-cite-prefix">On 22/10/2019 06:17, Sven Barth via
fpc-devel wrote:<br>
</div>
<blockquote type="cite"
cite="mid:3f5ae88d-cab7-76f5-9a95-0eb4badaa4a6@googlemail.com">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<div class="moz-cite-prefix">Am 22.10.2019 um 01:19 schrieb J.
Gareth Moreton:<br>
</div>
<blockquote type="cite"
cite="mid:3462c63e-6784-52b1-a146-ad42301a680b@moreton-family.com">
<meta http-equiv="content-type" content="text/html;
charset=UTF-8">
This is a very low-level semantic issue, but I'm not
particularly keen on how static methods are defined in classes.
</blockquote>
<br>
Not being "keen" on an existing, established syntax is not reason
enough to change it.<br>
<br>
Please also note (to probably annoy you further) that static
methods inside records use exactly the same syntax. ;)<br>
<br>
<blockquote type="cite"
cite="mid:3462c63e-6784-52b1-a146-ad42301a680b@moreton-family.com"><b>static
function </b>StaticMethod: Integer;
<p>****<br>
</p>
<p>For backward compatibility, I would suggest keeping the
'static' directive for class methods so existing code doesn't
break, but maybe mark it as deprecated.</p>
</blockquote>
This would introduce ambiguity especially with keeping the
original syntax:<br>
<br>
=== code begin ===<br>
<br>
class function Foo: Integer; static;<br>
function SomethingElse;<br>
<br>
vs.<br>
<br>
class function Foo: Integer;<br>
static function SomethingElse;<br>
<br>
=== code end ===<br>
<br>
The static directive is - like all other directives - parsed by
parse_proc_directives and it would consume the "static" token in
both cases. Then it would need to check for the existance of a
"function" or "procedure" token and pass that up it's call change.
There are places in the parser where this is indeed done, but
adjusting the parser that much for *no* gain is not something we
like to do.<br>
<br>
<blockquote type="cite"
cite="mid:3462c63e-6784-52b1-a146-ad42301a680b@moreton-family.com">P.S.
If I've missed something obvious as to why static methods are
implemented using a directive, please educate me!<br>
</blockquote>
Simple: Delphi compatibility.<br>
<br>
Regards,<br>
Sven<br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
fpc-devel maillist - <a class="moz-txt-link-abbreviated" href="mailto:fpc-devel@lists.freepascal.org">fpc-devel@lists.freepascal.org</a>
<a class="moz-txt-link-freetext" href="https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel">https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel</a>
</pre>
</blockquote>
<div id="DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2"><br />
<table style="border-top: 1px solid #D3D4DE;">
<tr>
<td style="width: 55px; padding-top: 13px;"><a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient" target="_blank"><img src="https://ipmcdn.avast.com/images/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif" alt="" width="46" height="29" style="width: 46px; height: 29px;" /></a></td>
<td style="width: 470px; padding-top: 12px; color: #41424e; font-size: 13px; font-family: Arial, Helvetica, sans-serif; line-height: 18px;">Virus-free. <a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient" target="_blank" style="color: #4453ea;">www.avast.com</a>
</td>
</tr>
</table><a href="#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2" width="1" height="1"> </a></div></body>
</html>