[m-rev.] diff: tests/hard_coded/constraint_order carriage feed problems fix

Peter Ross pro at missioncriticalit.com
Fri Nov 29 05:47:59 AEDT 2002


Hi,


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


Estimated hours taken: 0.1
Branches: main

tests/hard_coded/constraint_order.m:
	Switch from using Console.Write to Console.WriteLine as this
	gives you consistent behaviour on whether or not a carriage
	feed is output.  This requires that we change printf to puts
	for the C code version.

Index: constraint_order.m
===================================================================
RCS file: /home/mercury1/repository/tests/hard_coded/constraint_order.m,v
retrieving revision 1.2
diff -u -r1.2 constraint_order.m
--- constraint_order.m	28 Nov 2002 16:33:44 -0000	1.2
+++ constraint_order.m	28 Nov 2002 18:45:43 -0000
@@ -28,17 +28,17 @@
 :- pragma no_inline(q/2).
 :- pragma terminates(q/2).
 
-q(_, 1) :- impure unsafe_write_string("call to q\n").
+q(_, 1) :- impure puts("call to q").
 
 :- pred test(int::di) is semidet.
 :- pragma promise_pure(test/1).
 :- pragma no_inline(test/1).
 :- pragma terminates(test/1).
 
-test(3) :- impure unsafe_write_string("call to test\n").
+test(3) :- impure puts("call to test").
 
-:- impure pred unsafe_write_string(string::in) is det.
+:- impure pred puts(string::in) is det.
 
-:- pragma c_code(unsafe_write_string(Str::in), "printf(Str);").
-:- pragma foreign_proc("C#", unsafe_write_string(Str::in), [],
-		"System.Console.Write(Str);").
+:- pragma c_code(puts(Str::in), "puts(Str);").
+:- pragma foreign_proc("C#", puts(Str::in), [],
+		"System.Console.WriteLine(Str);").

--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list