News for hackers. Stuff that matters.
Re:Try OCaml by wtetzner on Friday September 07, 2018 @09:35AM (#17934075)
Pattern matching doesn't require any kind of runtime support, and can be implemented through desugaring.
Re:Try OCaml by k__ on Friday September 07, 2018 @09:53AM (#17934212)
How so?
Re:Try OCaml by wtetzner on Thursday September 13, 2018 @06:28AM (#17977468)
Why would it need runtime support? It would just desugar into an if-else chain.
Re:Try OCaml by jaaames on Friday September 07, 2018 @10:55AM (#17934705)
I believe there was/is a stage 0 proposal for pattern matching in ECMAScript
Re:Try OCaml by k__ on Friday September 07, 2018 @11:06AM (#17934804)
Stage 1 and yes, this one simply uses destructuring.

But it could use JavaScripts own types.

But it couldn't use TypeScripts types.