Skip to content

Instantly share code, notes, and snippets.

@Schemetrical
Created October 18, 2019 09:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Schemetrical/b3d3eea30084b553c7ee57ea372abcd0 to your computer and use it in GitHub Desktop.
Save Schemetrical/b3d3eea30084b553c7ee57ea372abcd0 to your computer and use it in GitHub Desktop.

Proposal: OCaml pattern matching on non-literal strings

Project type: Making a change to the semantics (and possibly syntax) of an existing, widely-used programming language to fix some problem you (or the language’s community) perceives in that language.

How our project meets the requirements of its project type: We are changing the semantics of how pattern-matching works on a reasonably widely-used language (OCaml). This fixes a problem that prevents string matching to behave properly when the match cases are not string literals.

100%: Support using variables in match statements, as well as allowing for matching multiple items at the same time in a single match statement.

80%: Support using variables in matching single items in match statements for strings. Low risk approach because we do not need to consider language semantics that affect how multiple items are matched, as well as making syntax decisions for the multiple match.

Three documents as promising starting points:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment