develooper Front page | perl.perl5.porters | Postings from February 2021

Re: De-experimentalising "signatures"

Thread Previous | Thread Next
From:
Felipe Gasper
Date:
February 10, 2021 14:18
Subject:
Re: De-experimentalising "signatures"
Message ID:
21399FDC-D753-43DC-B165-304D747A2D19@felipegasper.com


> On Feb 10, 2021, at 7:25 AM, Paul LeoNerd Evans <leonerd@leonerd.org.uk> wrote:
> 
> Now I admit I don't know JavaScript, but it would surprise me if you
> didn't get any sort of runtime error when trying to call either of
> 
>  func(1);
>  func(1,2,3);

Surprise!

-----
> node -e 'function foo(bar, baz) { console.log(bar, baz) } foo(1, 2,3)'
1 2

> node -e 'function foo(bar, baz) { console.log(bar, baz) } foo()'
undefined undefined
-----

This, though, is something that in my experience JS devs widely regard as a defect in the language. TypeScript exists--and is popular--largely *because* it provides more such strictures.

-F


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About