3 ms·
i noticed this in the examples: | List p (List p2 (List p3 rest)) => false /* 3+ */ has the regular list destructuring in pattern match syntax been remov
by zem 10y ago
i noticed this in the examples:
| List p (List p2 (List p3 rest)) => false /* 3+ */
has the regular list destructuring in pattern match syntax been removed? that's pretty sad, if so - lists are the default data structure in ocaml, and it's worth retaining some special syntax for cons especially in pattern matches.
- chenglou 10y agoNo, the sugar's still there.
- ufo 10y agoFor me the odd bit is that they called the constructor List instead of Cons.
- jordwalke 10y agoThanks for the feedback. We can change it to `Cons`, but I was assuming that anyone who knew what `Cons` was, would know what `List` meant, but not everyone who understood what `List` meant, would know/recall what `Cons` meant.