On 2015-05-19 18:24, Steve Fink <[email protected]> writes: > On 05/19/2015 12:23 AM, Alan Schmitt wrote: >> On 2015-05-19 06:09, Bergi <[email protected]> writes: >> >>> Alternatively just use a single equals sign with a parameter list: >>> >>> let f(x) = y >>> let f() = y >> This looks very nice indeed. > > That visually collides with destructuring for me. > > let [a, b] = foo(); > let {a, b} = foo(); > let f(a, b) = foo(); # Very different > > I almost expect that last one to use f as a custom matcher of some sort, given > the previous two.
It is actually how it works in Ocaml: in "let f p = …", p is a pattern, which may destructure tuples such as the pair (a,b) above, or other constructs as long as they are not part of an alternation (where several cases may occur). Best, Alan -- OpenPGP Key ID : 040D0A3B4ED2E5C7
signature.asc
Description: PGP signature
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

