Hi Marc,

Please keep the mailing list in CC.

> But I don't agree with the naming of the modules. Since GMP includes
> > all three (mpn, mpz, mpq) in one library, the Gnulib module 'libgmp'
> > should do the same. This means, the existing libgmp module should be
> > renamed to 'libgmp-mpz', and the 'libgmp' module should then depend
> > on 'libgmp-mpz' and add the mini-mpq.[hc] code.
> >
> 
> I understand the motivation for the renaming but I wonder whether it is a
> good idea for the following two reasons:
> 
> (1) Existing codebases that have been importing the libgmp module to use
> the mpz functions will silently begin to pull the mpq functions into their
> binaries as soon as they update to the latest Gnulib version.  (This
> probably won't break any code, but it is imperfect.)
> 
> (2) GMP also includes mpf functions (although it advises to check out the
> separate MPFR package).  If, at some future point, mpf functions are
> provided in the form of mini-mpf.[ch], a module libgmp-mpq would have to be
> created and libgmp would again change its semantics.
> 
> Another reason why I didn't touch the name of the existing libgmp module in
> my original proposal is that it mirrors the naming convention of the
> mini-gmp project whose headers are mini-gmp.h for the mpz (and mpn)
> functions and mini-mpq.h for the mpq functions.

Ad (1): Yes, this is harmless; it will not break any package. But we can add
an entry in the NEWS file, to notify our users anyway.

Ad (2): Good point. Yes, then the module structure that we need is:
  - libgmp-mpz — as it is now
  - libgmp-mpq — mini-mpq.[hc]
  - libgmp — depends on libgmp-mpz, libgmp-mpq, may depend on libgmp-mpf in
    the future.

Ad (3): The naming convention in the mini-gmp project clearly is inconsistent.
We can keep the same file names here in the lib/ directory (since inconsistent
source file names are not a concern for the users of a module). But that's not
a good enough reason for dictating the module names.

> And the test source files should be renamed to
> >   tests/test-libgmp-mpz.c
> > and
> >   tests/test-libgmp-mpq.c
> > respectively.
> >
> > Let me start with the renamings of what is already in gnulib. Then,
> > your additions are welcome (as two patches, please: one for the
> > new code in module libgmp, and one for the new tests).
> >
> 
> Ah, so tests always get their own patch/commit?

Yes, when adding a new module, it's good to keep the lib code and the
tests code separate; it avoids making mistakes.

When making a change to an existing module, the test change most often
needs to be in the same commit as the lib change; that's a different
situation.

Bruno




Reply via email to