If we are not planning on supporting nested case I think we can greatly simplify the Pexp.Pcase => Lexp.Case code by replacing `Pcase of location * pexp * (ppat * pexp) list` by `Pcase of location * pexp * (ppat list * pexp) SMap.t with and ppat = | Ppatany of location | Ppatsym of pvar The current implementation can support nested patterns (but dont). The new one cant. Nevertheless, the new approach would prevent us from seeing a constructor as a pexp. I am not sure if we lose in generality that much and I think the code will be greatly reduced. -- Pierre Delaunay
Afficher les réponses par date
The current implementation can support nested patterns (but dont). The new one cant. Nevertheless, the new approach would prevent us from seeing a constructor as a pexp. I am not sure if we lose in generality that much and I think the code will be greatly reduced.
`pexp` should disappear "shortly", so I don't think it's worth the trouble. Stefan
participants (2)
-
Pierre Delaunay -
Stefan Monnier