[m-dev.] diff: fix some problems in the samples

Tyson Dowd trd at cs.mu.OZ.AU
Tue Feb 1 16:24:14 AEDT 2000


Hi,

I'm writing test scripts for the extras and samples and came across
these problems.

===================================================================


Estimated hours taken: 1

Fix some problems in the samples.

samples/calculator.m:
	Strip spaces from the input before using it.
	I keep forgetting that spaces aren't allowed in the input
	of this example, and I can only assume that new users get
	confused over this.

samples/c_interface/c_calls_mercury/Mmakefile:
	Use MLOBJS instead of MLLIBS for including .o files.
	Add a missing dependency.
	Remove an unnecessary dependency that MLOBJS takes care of.

samples/c_interface/mercury_calls_fortran/Mmakefile:
	Use MLOBJS instead of MLLIBS for including .o files.
	Use -lg2c instead of the old -lf2c for the fortran library.
	(libf2c no longer exists)


Enter passphrase for RSA key 'trd at hydra': 
Index: calculator.m
===================================================================
RCS file: /home/mercury1/repository/mercury/samples/calculator.m,v
retrieving revision 1.8
diff -u -r1.8 calculator.m
--- calculator.m	1999/11/04 03:16:51	1.8
+++ calculator.m	2000/02/01 05:19:39
@@ -31,7 +31,8 @@
 		io__write_string("Error reading from stdin\n")
 	; { Res = eof },
 		io__write_string("EOF\n")
-	; { Res = ok(Line) },
+	; { Res = ok(Line0) },
+		{ list__delete_all(Line0, ' ', Line) },
 		( { fullexpr(X,Line,[]) } ->
 			{ Num = evalexpr(X) },
 			io__write_int(Num),
Index: c_interface/c_calls_mercury/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/samples/c_interface/c_calls_mercury/Mmakefile,v
retrieving revision 1.3
diff -u -r1.3 Mmakefile
--- c_interface/c_calls_mercury/Mmakefile	1999/09/16 04:46:18	1.3
+++ c_interface/c_calls_mercury/Mmakefile	2000/02/01 05:19:39
@@ -13,14 +13,11 @@
 MLFLAGS=-g
 
 # tell the Mercury linker to link in c_main.o and mercury_lib.o
-MLLIBS=c_main.o mercury_lib.o
+MLOBJS=c_main.o mercury_lib.o
 
 #-----------------------------------------------------------------------------#
 
-# tell mmake that it needs to make c_main.o before it can make mercury_main
-mercury_main: c_main.o
-
-c_main.o: mercury_lib.h
+c_main.o: mercury_lib.h c_main.h
 
 # to make mercury_lib.h, just compile mercury_lib.m;
 # the Mercury compiler will create mercury_lib.h as a side-effect.
Index: c_interface/mercury_calls_fortran/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/samples/c_interface/mercury_calls_fortran/Mmakefile,v
retrieving revision 1.2
diff -u -r1.2 Mmakefile
--- c_interface/mercury_calls_fortran/Mmakefile	1999/09/16 04:46:20	1.2
+++ c_interface/mercury_calls_fortran/Mmakefile	2000/02/01 05:19:39
@@ -20,7 +20,8 @@
 all: mercury_main
 
 # tell the Mercury linker to link in fortran_main.o and libf2c
-MLLIBS=fortran_main.o -lf2c
+MLOBJS=fortran_main.o
+MLLIBS=-lg2c
 
 # tell mmake that it needs to make fortran_main.o before it can make
 # mercury_main


-- 
       Tyson Dowd           # 
                            #  Surreal humour isn't eveyone's cup of fur.
     trd at cs.mu.oz.au        # 
http://www.cs.mu.oz.au/~trd #
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list