ocamlbuild icon indicating copy to clipboard operation
ocamlbuild copied to clipboard

Avoid manual repetition of suffixes in a make script

Open elfring opened this issue 8 years ago • 4 comments

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?

elfring avatar Jul 01 '17 14:07 elfring

Efficiency is really not a concern here. I'd be surprised if ocamlbuild spends even a hundred milliseconds in make itself.

whitequark avatar Jul 01 '17 15:07 whitequark

Do you like a bit of code reduction more there?

elfring avatar Jul 01 '17 15:07 elfring

Yeah, that's a perfectly sensible change.

whitequark avatar Jul 01 '17 15:07 whitequark

@elfring would you like to send a pull request?

gasche avatar Jul 01 '17 16:07 gasche