[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [Libguestfs] [PATCH 1/5] mllib: Don't alias G = Guestfs in Common_utils module.



On Wed, Oct 07, 2015 at 01:25:57PM +0200, Pino Toscano wrote:
> On Tuesday 06 October 2015 13:30:46 Richard W.M. Jones wrote:
> > ---
> >  mllib/common_utils.ml | 4 +---
> >  1 file changed, 1 insertion(+), 3 deletions(-)
> > 
> > diff --git a/mllib/common_utils.ml b/mllib/common_utils.ml
> > index f8fa8fd..f9c45cc 100644
> > --- a/mllib/common_utils.ml
> > +++ b/mllib/common_utils.ml
> > @@ -20,8 +20,6 @@ open Printf
> >  
> >  open Common_gettext.Gettext
> >  
> > -module G = Guestfs
> > -
> 
> Hm weren't we using that alias in our .ml files, usually?

Yup, but the one here isn't exported so can't be seen outside the
module (and we wouldn't want that).

> Not a big deal, I just remember changes in the opposite way of this
> patch, so just wondering what would be the preferred way (especially
> that there is a .mli for this, so the alias won't pollute users of the
> module).

On a per-.ml file, if you're using a lot of 'Guestfs.*' prefixes in
that file, then feel free to declare 'module G = Guestfs' at the top
of the same file.  (The same goes for any other module that is used
frequently)

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-p2v converts physical machines to virtual machines.  Boot with a
live CD or over the network (PXE) and turn machines into KVM guests.
http://libguestfs.org/virt-v2v


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]