[Pas2js] Possible feature? keep the original JS overload behavior

silvioprog silvioprog at gmail.com
Fri Dec 21 20:59:46 CET 2018


On Fri, Dec 21, 2018 at 4:54 PM Mattias Gaertner via Pas2js <
pas2js at lists.freepascal.org> wrote:

> On Fri, 21 Dec 2018 20:17:04 +0100 (CET)
> Michael Van Canneyt <michael at freepascal.org> wrote:
>
> > On Fri, 21 Dec 2018, silvioprog wrote:
> >
> > > On Fri, Dec 21, 2018 at 3:08 PM Michael Van Canneyt
> > > <michael at freepascal.org> wrote:
> > >
> > >> I think that should be possible, but only for external functions.
> > >>
> > >> Michael.
> > >
> > >
> > > sorry, but it sounds very strange for me:
> >
> > I meant, what you propose (omitting optional args) should be possible
> > for external functions.
>
> Why forbid it for Pascal functions?
>
> Mattias


Just a suggestion: should be possible for functions marked as assembler.
For example:

function foo(a: integer = 0; b: integer = 0); assembler; *nodefaults;*
asm
end;

foo; --> OK
foo(123); --> OK
foo(123, 456); --> OK
foo(123, 456, 789); --> Error at build time

--
Silvio Clécio
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/pas2js/attachments/20181221/de0b46e9/attachment.html>


More information about the Pas2js mailing list