[Libguestfs] [PATCH v2 1/4] common/mlstdutils: Extend the List module.

Pino Toscano ptoscano at redhat.com
Tue Nov 7 14:16:31 UTC 2017


On Sunday, 8 October 2017 23:26:53 CET Richard W.M. Jones wrote:
> We defined a number of functions on lists which are not provided by
> the standard library.  As with Char and String, let's extend List to
> add these new functions to a List pseudo-module (really
> Std_utils.List, but called List when you ‘open Std_utils’).
> 
> The initial exported functions are all List functions from OCaml 3.11
> + iteri + mapi.  We can add other functions as needed.
> ---

My worry about this is that:
- OCaml does not have OOTB support for conditional code depending on the
  version
- the interface of the List module would get "frozen" this way, and
  overrides the module in the standard library
then we could run into issues like commit
7cd27531154dd25d9093cf04c085a3669bc834e5, i.e. restricting the interface
because of compatibility issues.

Also IMHO this makes more difficult to know what's stdlib and what's
ours, when using the API -- I guess I mentioned that when String was
introduced, maybe...

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


More information about the Libguestfs mailing list