Skip to content
Success

Changes

Summary

  1. matching: factorize the make_*_matching functions (commit: 0651396) (details)
Commit 065139617ff654a26b02af021a22f694013b843f by gabriel.scherer
matching: factorize the make_*_matching functions

Before, each head construction had a `make_<foo>_matching` construct that
was responsible for three things:
- consuming the argument from the argument list
  (the "argument" is a piece of lambda code to access
   the value of the current scrutinee)
- building arguments for the subpatterns of the scrutinee
  and pushing them to the argument list
- building a `cell` structure out of this, representing a head group
  during compilation

Only the second point is really specific to each construction.

This refactoring turns this second point into a construct-specific
`get_expr_args_<foo>` function (similarly to `get_pat_args_<foo>`),
and moves the first and third point to a generic `make_matching`
function.

Note: this commit contains a minor improvement to the location used to
force (lazy ..) arguments.
(commit: 0651396)
The file was modifiedChanges (diff)
The file was modifiedlambda/matching.ml (diff)