ocamlbuild
ocamlbuild copied to clipboard
Avoid manual repetition of suffixes in a make script
A suffix like “cmo” is repeated several times for the definition of two variables. I suggest to avoid this.
- The function “addsuffix” can perform the desired data transformation for you.
- It can also be a bit more efficient to append suffixes at other places instead of replacing them, can't it?
Efficiency is really not a concern here. I'd be surprised if ocamlbuild spends even a hundred milliseconds in make itself.
Do you like a bit of code reduction more there?
Yeah, that's a perfectly sensible change.
@elfring would you like to send a pull request?