<div dir="auto"><div><div class="gmail_quote"><div dir="ltr">On Tue, Dec 25, 2018, 05:51 Michael Van Canneyt <<a href="mailto:michael@freepascal.org">michael@freepascal.org</a> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
On Mon, 24 Dec 2018, silvioprog wrote:<br>
<br>
> On Mon, Dec 24, 2018 at 7:01 PM Mattias Gaertner via Pas2js <<br>
> <a href="mailto:pas2js@lists.freepascal.org" target="_blank" rel="noreferrer">pas2js@lists.freepascal.org</a>> wrote:<br>
><br>
>> On Fri, 21 Dec 2018 22:50:01 +0100 (CET)<br>
>> Michael Van Canneyt <<a href="mailto:michael@freepascal.org" target="_blank" rel="noreferrer">michael@freepascal.org</a>> wrote:<br>
>><br>
>>> [...]<br>
>>>> Why forbid it for Pascal functions?<br>
>>> The purpose of pas2js is to allow pascal to run in the browser.<br>
>>> The purpose is not to make pascal behave like Javascript.<br>
>>> I want to bend Javascript, not bend pascal. So if we really must bend<br>
>>> pascal to accomodate interaction with external JS code,<br>
>>> I prefer it limited to that use case alone :-)<br>
>><br>
>> Good point.<br>
>><br>
>> In that case the default value is not needed and syntax could be:<br>
>><br>
>> procedure f(w: jsvalue = JSOmitArg); external name 'f';<br>
>><br>
>> where JSOmitArg is a special value that is omitted.<br>
>> Advantage: no need to adapt Delphi/Lazarus.<br>
>><br>
>> Mattias<br>
><br>
><br>
> That would be great.<br>
><br>
> Will it be compatible to other types? E.g:<br>
><br>
> procedure f(w: Integer = JSOmitArg); overload; external name 'f';<br>
> procedure f(w: string = JSOmitArg); overload; external name 'f';<br>
><br>
> In the example above only Integers and Strings are allowed in f().<br>
><br>
> p.s: JSDefault could be an option too. :-) E.g:<br>
><br>
> procedure f(w: JSValue = JSDefault); external ...<br>
<br>
I would then suggest to use "undefined" ?<br>
<br>
procedure f(w: Integer = undefined); overload; external name 'f';<br>
<br>
it exists in javascript, the meaning is clear, I think.<br>
<br>
Michael.</blockquote></div></div><div dir="auto"><br></div><div dir="auto"><span style="font-family:sans-serif">A single word is great. In a poll I would check the"undefined" option. :-)</span><br></div><div dir="auto"><br></div><div dir="auto">Merry Christmas / Feliz Natal! 🎅</div><div dir="auto"><br></div><div dir="auto">--</div><div dir="auto">Silvio Clecio</div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
</blockquote></div></div></div>