yoriyuki / Camomile

A Unicode library for OCaml
Other
125 stars 26 forks source link

camomile doesn't compile with OCaml 4.06 #35

Closed kit-ty-kate closed 7 years ago

kit-ty-kate commented 7 years ago

The upcoming OCaml release (4.06) has now safe-string enabled by default. However camomile isn't compatible with safe-string yet.

I don't have time to make a PR but I'd be happy to give any kind of help in fixing this.

yoriyuki commented 7 years ago

The right solution is of course use Byte. but is there any easy way out? (say, compile option)

kit-ty-kate commented 7 years ago

You could set OCAMLPARAM=safe-string=0,_ before building the modules to be fixed, but as you can tell it could only be a temporary fix, and an unclean one moreover. The only real solution IMHO, if you want to stay compatible with OCaml < 4.02, is to use the bytes compatibility library (from ocamlfind) and/or the Buffer module when it is more appropriate.

yoriyuki commented 7 years ago

Changing String to Buffer/Bytes is a daunting task. Mostly it requires just search/replace, but you have to check the correctness and sometimes API would need to be changed. We need a temporary but easy fix. I will take a look to how to set a OCAMLPARAM in the build procedure.