<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">On Fri, Dec 21, 2018 at 3:58 PM Mattias Gaertner via Pas2js <<a href="mailto:pas2js@lists.freepascal.org">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 15:19:50 -0300<br>
silvioprog <<a href="mailto:silvioprog@gmail.com" target="_blank">silvioprog@gmail.com</a>> wrote:<br>
<br>
>[...]<br>
> function foo; varargs 2; ...<br>
> <br>
> I never saw a compiler/language limiting the arguments in a variadic<br>
> function, but ... 😀<br>
<br>
Yes, what is needed is a procedure modifier or directive to omit<br>
passing default values.<br></blockquote><div><br></div><div>Perfect!</div><div><br></div><div>Or both options. For example, in some cases (small JS libraries) we can use it:</div><div><br></div><div>procedure foo(a: integer = 0; b: integer = 0); external; some_new_directive_we_will_provide; ...<br></div><div>procedure bar(a: integer = 0; b: integer = 0); external; some_new_directive_we_will_provide; ...<br></div><div><br></div><div>or (big JS library containing a lot of functions in their APIs):</div><div><br></div><div>{$SOME_NEW_DIRECTIVE_WE_WILL_PROVIDE ON}</div><div><br></div><div><div>procedure foo(a: integer = 0; b: integer = 0); external; ...<br></div><div>procedure bar(a: integer = 0; b: integer = 0); external; ...<br></div><br class="gmail-Apple-interchange-newline"></div><div>SOME_NEW_DIRECTIVE_WE_WILL_PROVIDE = some new keyword or switch name in a single intuitive word.<br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Keep in mind that code should be editable in Delphi IDE too. Maybe<br>
misusing a calling convention?<br></blockquote><div><br></div><div>They will play on Delphi like a charm. :-)</div><div>Â </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
>[...]<br>
> I probably will change my transpiler copy allowing to omit the default<br>
> parameters in the generated script. 😅<br>
<br>
The power of open source. :)<br></blockquote></div><div><br></div><div>oh yes! 😀</div><div><br></div><div>I'm asking some other friends via telegram/whatsapp to check possible new ideas to share, but a new keyword (for single function) and a switch (for the entire unit) sounds very good.</div><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>Silvio Clécio</div></div></div></div></div></div>