<div dir="ltr"><div dir="ltr">On Fri, Dec 21, 2018 at 4:59 PM silvioprog <<a href="mailto:silvioprog@gmail.com">silvioprog@gmail.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr">On Fri, Dec 21, 2018 at 4:54 PM Mattias Gaertner via Pas2js <<a href="mailto:pas2js@lists.freepascal.org" target="_blank">pas2js@lists.freepascal.org</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Fri, 21 Dec 2018 20:17:04 +0100 (CET)<br>
Michael Van Canneyt <<a href="mailto:michael@freepascal.org" target="_blank">michael@freepascal.org</a>> wrote:</blockquote></div></div></blockquote></div><div><br></div><div>Dudes, possible ideas I checked with other friends:</div><div><br></div><div>- <b><font face="monospace, monospace">nodefaults</font></b> - new keyword: it allows to omit the default arguments in a single external or assembler function.</div><div>- <font color="#ff0000" face="monospace, monospace">$OMIT_DEFAULT_PARAMS ON|OFF</font> - new compiler switch: it allows to omit the default arguments in a single external or assembler function or in the entire unit.</div><div><br></div><div>Some examples using the keyword:</div><div><br></div><div>function foo(a: integer = 0; b: integer = 0); <b>nodefaults</b>; external name 'foo';</div><div>function bar(a, b: integer = 0); <b>nodefaults</b>; external name 'bar';<br></div><div><br></div><div>Note: since the 'nodefaults' was defined to 'bar', you can declare default params using the short way "a,b: integer = 0" or the verbose one "a: integer = 0; b: integer = 0".</div><div><br></div><div>Some examples using the swtch:<br></div><div><br></div><div><font color="#ff0000">{$OMIT_DEFAULT_PARAMS ON}</font></div><div><br></div><div><div>function foo(a: integer = 0; b: integer = 0); external name 'foo';</div><div>function bar(a, b: integer = 0); external name 'bar';</div></div><div>function foobar(a, b: integer = 0); assembler;<br></div><div><br></div><div>All functions above allows to omit default params. Or:</div><div><br></div><div><font color="#ff0000">{$PUSH}{$OMIT_DEFAULT_PARAMS ON}</font></div><div><div>function foo(a: integer = 0; b: integer = 0); external name 'foo';<br></div><div><div>function bar(a, b: integer = 0); external name 'bar';</div></div><div><font color="#ff0000">{$POP}</font><br></div><div>function foobar(a, b: integer = 0); assembler;</div></div><div><br></div><div>only "foo()" and "bar()" allows to omit their params.</div><div><br></div><div>What do you think?</div><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>Silvio Clécio</div></div></div></div>