<div dir="ltr"><div dir="ltr"><div dir="ltr">On Thu, Dec 20, 2018 at 1:08 PM Mattias Gaertner via Pas2js <<a href="mailto:pas2js@lists.freepascal.org">pas2js@lists.freepascal.org</a>> wrote:</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">
Note: To avoid the array brackets and name conflicts, it could be<br>
defined like this:<br>
function new(Name:string; value:jsvalue): TJSObject; varargs; overload;<br></blockquote><div><br></div><div>Yes, I've tried variadic function. :-)</div><div><br></div><div>It is a good idea, but remember:</div><div><br></div><div>var o = {};</div><div><br></div><div>so it would necessary:</div><div><br></div><div>o := new;</div><div><br></div><div>but the function(<Name>;<Value>) obligates to pass at least a pair. :-)</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">
> I don't want too much "tricks" in the compiler. If later we can think<br>
> of a way to do this in a good pascal-ish manner, we'll of course do<br>
> it.<br>
<br>
Are you speaking of the "external name '{}'"?<br>
The direct {} notation requires compiler magic.</blockquote></div><div><br></div><div>Yes. It would be useful.</div><div><br></div>--<br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>Silvio Clécio</div></div></div></div></div>