Reduce equal & compare boilerplate using deriving eq & ord#227
Reduce equal & compare boilerplate using deriving eq & ord#227
Conversation
It kind of annoys me how such comparisons are spread around. For example Then one doesn't need to define I'll pursue this line of refactoring in a separate branch and PR. I think it's reasonable to have common and well-behaved implementations for most |
|
analyzer/src/cdomains/basetype.ml Lines 217 to 239 in 274d41d Lines 525 to 534 in 274d41d These and some other such places seem problematic in light of from https://github.com/ocaml-ppx/ppx_deriving#plugins-eq-and-ord One should probably patch all such places to return values from [-1,1]? |
I noticed that at some point too, but chose to ignore it, because it worked regardless. And |
Issue #31.
I went through the
equalandcomparedefinitions and replaced suitable ones with derivingeqandord.Some more boilerplate could be removed by moving some CIL-specific implementations that only compare IDs into
Deriving.Cil. Right now their comparisons are duplicated all over the place.