Comments on Refutable Patterns proposal

Axel Rauschmayer axel at
Thu Mar 21 11:01:15 PDT 2013

>> Ah! I would expect [x,y] to only match arrays whose length is 2. Is there a benefit to being more lenient?
> I wouldn't expect that at all, for the same reason I would expect `let { x, y } = { x: 1, y: 2, z: 3 }` to work.

I’m influenced by Prolog that has [x,y] and [x,y | rest]. Matching by position feels different to me than matching by key, but I see your point. It is also consistent with how function parameters are handled.

Dr. Axel Rauschmayer
axel at


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list