realworldocaml / book

V2 of Real World OCaml
https://dev.realworldocaml.org
Other
1.19k stars 175 forks source link

New comment on block [block-idp7782352] #1832

Closed gregtatcam closed 11 years ago

gregtatcam commented 11 years ago

or-pattern was first used/explained in Variables and Functions:Recursive functions.

bactrian commented 11 years ago

This comment references this from milestone beta1: https://realworldocaml.org/beta1/en/html/lists-and-patterns.html#idp7782352

Context:

One feature of OCaml's pattern language that we've encountered here for the first time is or-patterns, which allow you to have multiple sub-patterns within a larger pattern. In this case, None | Some ("",_) is an or-pattern. As we'll see later, or-patterns can be nested anywhere within larger patterns.
yminsky commented 11 years ago

Removed the claim of novelty.