[Libguestfs] [PATCH 5/5] mllib: Replace various ad hoc string_* functions with String.*

Pino Toscano ptoscano at redhat.com
Wed Oct 7 11:48:11 UTC 2015


On Tuesday 06 October 2015 13:30:50 Richard W.M. Jones wrote:
> This is just a straight refactoring.  Various ad hoc string_*
> functions that appeared in Common_utils have been renamed and placed
> in the String.* namespace.  The old vs "new" functions are:
> 
> string_prefix  -> String.is_prefix
> string_suffix  -> String.is_suffix
> string_find    -> String.find
> replace_str    -> String.replace
> string_nsplit  -> String.nsplit
> string_split   -> String.split
> string_lines_split -> String.lines_split
> string_random8 -> String.random8
> ---

As mentioned yesterday on IRC, I'm torn about this one: the functions
would automatically alias functions with the same name, whenever
available in OCaml' stdlib.  Also (but this is more personal), reading
String.foo would make me think that it is part of the String module,
and go reading its help on the documentation of the String module.

-- 
Pino Toscano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://listman.redhat.com/archives/libguestfs/attachments/20151007/f25d9a7a/attachment.sig>


More information about the Libguestfs mailing list