diff: package up extras/complex_numbers

Fergus Henderson fjh at cs.mu.OZ.AU
Sat May 30 04:36:33 AEST 1998


On 29-May-1998, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> Use sub-modules to package up the modules in extras/complex_numbers
> into a single module.
> 
> extras/complex_numbers/complex_lib.m:
> extras/complex_numbers/complex_numbers.m:
> 	Rename complex_lib.m as complex_numbers.m,
> 	and modify it to use sub-modules.
> 
> extras/complex_numbers/*.m:
> extras/complex_numbers/tests/complex_test.m:
> extras/complex_numbers/samples/fft.m:
> 	Add `complex_numbers:' to all of the `:- module'
> 	and `:- import_module' declarations.
> 
> extras/complex_numbers/Mmakefile:
> extras/complex_numbers/tests/Mmakefile:
> extras/complex_numbers/samples/Mmakefile:
> 	Modify to reflect the renaming from `complex_lib' to
> 	`complex_numbers'.

As usual, I forgot to include the actual diff.

cvs diff: Diffing .
Index: Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/complex_numbers/Mmakefile,v
retrieving revision 1.1
diff -u -u -r1.1 Mmakefile
--- Mmakefile	1997/08/14 12:36:43	1.1
+++ Mmakefile	1998/05/29 04:02:00
@@ -1,3 +1,3 @@
 MAIN_TARGET = all
-depend: complex_lib.depend
-all: libcomplex_lib
+depend: complex_numbers.depend
+all: libcomplex_numbers
Index: complex.m
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/complex_numbers/complex.m,v
retrieving revision 1.3
diff -u -u -r1.3 complex.m
--- complex.m	1997/07/27 15:05:56	1.3
+++ complex.m	1998/05/29 04:01:02
@@ -19,7 +19,7 @@
 %
 %---------------------------------------------------------------------------%
 
-:- module complex.
+:- module complex_numbers:complex.
 :- interface.
 
 :- type complex ---> cmplx(float, float).	% real part, imag part
Index: complex_float.m
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/complex_numbers/complex_float.m,v
retrieving revision 1.2
diff -u -u -r1.2 complex_float.m
--- complex_float.m	1997/07/27 15:05:57	1.2
+++ complex_float.m	1998/05/29 04:01:02
@@ -15,9 +15,9 @@
 %
 %---------------------------------------------------------------------------%
 
-:- module complex_float.
+:- module complex_numbers:complex_float.
 :- interface.
-:- import_module complex, float.
+:- import_module complex_numbers:complex, float.
 
 	% addition
 :- func complex + float = complex.
@@ -50,7 +50,7 @@
 %---------------------------------------------------------------------------%
 
 :- implementation.
-:- import_module complex_float.
+:- import_module complex_numbers:complex_float.
 
 cmplx(XR, XI) + YR = cmplx(XR + YR, XI).
 cmplx(XR, XI) - YR = cmplx(XR - YR, XI).
Index: complex_imag.m
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/complex_numbers/complex_imag.m,v
retrieving revision 1.2
diff -u -u -r1.2 complex_imag.m
--- complex_imag.m	1997/07/27 15:05:58	1.2
+++ complex_imag.m	1998/05/29 04:01:03
@@ -15,9 +15,9 @@
 %
 %---------------------------------------------------------------------------%
 
-:- module complex_imag.
+:- module complex_numbers:complex_imag.
 :- interface.
-:- import_module complex, imag.
+:- import_module complex_numbers:complex, complex_numbers:imag.
 
 	% addition
 :- func complex + imag = complex.
Index: complex_lib.m
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/complex_numbers/complex_lib.m,v
retrieving revision 1.2
diff -u -u -r1.2 complex_lib.m
--- complex_lib.m	1997/07/27 15:05:59	1.2
+++ complex_lib.m	1998/05/29 04:01:03
@@ -3,7 +3,8 @@
 % This file may only be copied under the terms of the GNU Library General
 % Public License - see the file COPYING.LIB in the Mercury distribution.
 %---------------------------------------------------------------------------%
-:- module complex_lib.
-:- import_module complex, float, imag.
-:- import_module complex_imag, imag_complex.
-:- import_module float_imag, imag_float.
+:- module complex_numbers.
+:- interface.
+:- include_module complex, imag.
+:- include_module complex_imag, imag_complex.
+:- include_module float_imag, imag_float.
Index: float_complex.m
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/complex_numbers/float_complex.m,v
retrieving revision 1.2
diff -u -u -r1.2 float_complex.m
--- float_complex.m	1997/07/27 15:06:00	1.2
+++ float_complex.m	1998/05/29 04:01:03
@@ -15,9 +15,9 @@
 %
 %---------------------------------------------------------------------------%
 
-:- module float_complex.
+:- module complex_numbers:float_complex.
 :- interface.
-:- import_module float, complex.
+:- import_module float, complex_numbers:complex.
 
 	% addition
 :- func float + complex = complex.
@@ -46,7 +46,7 @@
 %---------------------------------------------------------------------------%
 
 :- implementation.
-:- import_module complex_float.
+:- import_module complex_numbers:complex_float.
 
 XR + cmplx(YR, YI) = cmplx(XR + YR, + XI).
 XR - cmplx(YR, YI) = cmplx(XR - YR, - YI).
Index: float_imag.m
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/complex_numbers/float_imag.m,v
retrieving revision 1.2
diff -u -u -r1.2 float_imag.m
--- float_imag.m	1997/07/27 15:06:01	1.2
+++ float_imag.m	1998/05/29 04:01:03
@@ -15,9 +15,9 @@
 %
 %---------------------------------------------------------------------------%
 
-:- module float_imag.
+:- module complex_numbers:float_imag.
 :- interface.
-:- import_module float, imag, complex.
+:- import_module float, complex_numbers:imag, complex_numbers:complex.
 
 	% addition
 :- func float + imag = complex.
Index: imag.m
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/complex_numbers/imag.m,v
retrieving revision 1.2
diff -u -u -r1.2 imag.m
--- imag.m	1997/07/27 15:06:02	1.2
+++ imag.m	1998/05/29 04:01:03
@@ -26,7 +26,7 @@
 %
 %---------------------------------------------------------------------------%
 
-:- module imag.
+:- module complex_numbers:imag.
 :- interface.
 :- import_module float.
 
Index: imag_complex.m
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/complex_numbers/imag_complex.m,v
retrieving revision 1.2
diff -u -u -r1.2 imag_complex.m
--- imag_complex.m	1997/07/27 15:06:03	1.2
+++ imag_complex.m	1998/05/29 04:01:04
@@ -15,9 +15,9 @@
 %
 %---------------------------------------------------------------------------%
 
-:- module imag_complex.
+:- module complex_numbers:imag_complex.
 :- interface.
-:- import_module imag, complex.
+:- import_module complex_numbers:imag, complex_numbers:complex.
 
 	% addition
 :- func imag + complex = complex.
Index: imag_float.m
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/complex_numbers/imag_float.m,v
retrieving revision 1.2
diff -u -u -r1.2 imag_float.m
--- imag_float.m	1997/07/27 15:06:03	1.2
+++ imag_float.m	1998/05/29 04:01:04
@@ -15,9 +15,9 @@
 %
 %---------------------------------------------------------------------------%
 
-:- module imag_float.
+:- module complex_numbers:imag_float.
 :- interface.
-:- import_module imag, float, complex.
+:- import_module complex_numbers:imag, float, complex_numbers:complex.
 
 	% addition
 :- func imag + float = complex.
@@ -44,7 +44,6 @@
 %---------------------------------------------------------------------------%
 
 :- implementation.
-:- import_module float.
 
 im(XI) + YR = cmplx(0.0 + YR, 0.0 + XI).
 im(XI) - YR = cmplx(0.0 - YR, 0.0 + XI).
cvs diff: Diffing samples
Index: samples/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/complex_numbers/samples/Mmakefile,v
retrieving revision 1.1
diff -u -u -r1.1 Mmakefile
--- Mmakefile	1997/07/16 07:54:29	1.1
+++ Mmakefile	1998/05/29 04:04:29
@@ -1,12 +1,13 @@
-# COMPLEX_NUMBER_DIR specifies the location of the complex number library,
+# COMPLEX_NUMBERS_DIR specifies the location of the complex number library,
 # e.g. `/foo/bar/mercury-<version>/extra/complex_numbers'.
-COMPLEX_NUMBER_DIR = ..
+COMPLEX_NUMBERS_DIR = ..
 
 # The following stuff tells Mmake to use the complex number library
-VPATH = $(COMPLEX_NUMBER_DIR):$(MMAKE_VPATH)
-MCFLAGS = -I$(COMPLEX_NUMBER_DIR)
-MLFLAGS = -R$(COMPLEX_NUMBER_DIR) -L$(COMPLEX_NUMBER_DIR)
-MLLIBS = -lmercomplex
+VPATH = $(COMPLEX_NUMBERS_DIR):$(MMAKE_VPATH)
+MCFLAGS = -I$(COMPLEX_NUMBERS_DIR)
+MLFLAGS = -R$(COMPLEX_NUMBERS_DIR) -L$(COMPLEX_NUMBERS_DIR)
+MLLIBS = -lcomplex_numbers
+C2INITFLAGS = $(COMPLEX_NUMBERS_DIR)/complex_numbers.init
 
 MAIN_TARGET = fft
 depend : fft.depend
cvs diff: Diffing tests
Index: tests/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/complex_numbers/tests/Mmakefile,v
retrieving revision 1.1
diff -u -u -r1.1 Mmakefile
--- Mmakefile	1997/07/16 07:54:35	1.1
+++ Mmakefile	1998/05/29 04:02:44
@@ -1,13 +1,13 @@
-# COMPLEX_NUMBER_DIR specifies the location of the complex number library,
+# COMPLEX_NUMBERS_DIR specifies the location of the complex number library,
 # e.g. `/foo/bar/mercury-<version>/extra/complex_numbers'.
-COMPLEX_NUMBER_DIR = ..
+COMPLEX_NUMBERS_DIR = ..
 
 # The following stuff tells Mmake to use the complex number library
-VPATH = $(COMPLEX_NUMBER_DIR):$(MMAKE_VPATH)
-MCFLAGS = -I$(COMPLEX_NUMBER_DIR) $(EXTRA_MCFLAGS)
-MLFLAGS = -R$(COMPLEX_NUMBER_DIR) -L$(COMPLEX_NUMBER_DIR) $(EXTRA_MLFLAGS)
-MLLIBS = -lcomplex_lib $(EXTRA_MLLIBS)
-C2INITFLAGS = $(COMPLEX_NUMBER_DIR)/complex_lib.init
+VPATH = $(COMPLEX_NUMBERS_DIR):$(MMAKE_VPATH)
+MCFLAGS = -I$(COMPLEX_NUMBERS_DIR) $(EXTRA_MCFLAGS)
+MLFLAGS = -R$(COMPLEX_NUMBERS_DIR) -L$(COMPLEX_NUMBERS_DIR) $(EXTRA_MLFLAGS)
+MLLIBS = -lcomplex_numbers $(EXTRA_MLLIBS)
+C2INITFLAGS = $(COMPLEX_NUMBERS_DIR)/complex_numbers.init
 
 MAIN_TARGET = complex_test.res
 
Index: tests/complex_test.m
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/complex_numbers/tests/complex_test.m,v
retrieving revision 1.1
diff -u -u -r1.1 complex_test.m
--- complex_test.m	1997/07/16 07:54:37	1.1
+++ complex_test.m	1998/05/29 04:03:37
@@ -7,9 +7,11 @@
 :- pred main(state::di, state::uo) is det.
 
 :- implementation.
-:- import_module complex, float, imag.
-:- import_module complex_imag, imag_complex.
-:- import_module float_imag, imag_float.
+:- import_module float.
+:- import_module complex_numbers.
+:- import_module complex_numbers:complex, complex_numbers:imag.
+:- import_module complex_numbers:complex_imag, complex_numbers:imag_complex.
+:- import_module complex_numbers:float_imag, complex_numbers:imag_float.
 
 main -->
 	print("tests of (complex op complex)"), nl,

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- the last words of T. S. Garp.



More information about the developers mailing list