diff options
author | Emilio Jesus Gallego Arias <e+git@x80.org> | 2017-02-23 03:48:50 +0100 |
---|---|---|
committer | Emilio Jesus Gallego Arias <e+git@x80.org> | 2017-03-14 22:19:25 +0100 |
commit | 7601ddc3500cae2da39883b339951205be19c41d (patch) | |
tree | c586741e5e3202848deae3da5ae879af27c3d6d1 /kernel/names.ml | |
parent | 581b8d52fe93d666045d4878a1b48dad916451ec (diff) |
[safe_string] library/nameops
We add a more convenient API to create identifiers from mutable
strings. We cannot solve the `String.copy` deprecation problem until
we enable `-safe-string`.
Diffstat (limited to 'kernel/names.ml')
-rw-r--r-- | kernel/names.ml | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/kernel/names.ml b/kernel/names.ml index 1f138581c..831b6ad46 100644 --- a/kernel/names.ml +++ b/kernel/names.ml @@ -50,6 +50,11 @@ struct | None -> true | Some _ -> false + let of_bytes s = + let s = Bytes.to_string s in + check_soft s; + String.hcons s + let of_string s = let () = check_soft s in let s = String.copy s in |