[m-rev.] diff: append_ioi in MC++

Peter Ross peter.ross at miscrit.be
Thu Jul 26 01:48:20 AEST 2001


Hi,


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


Estimated hours taken: 0.25
Branches: main

library/string.m:
    Implement append_ioi in MC++.

Index: string.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/string.m,v
retrieving revision 1.146
diff -u -r1.146 string.m
--- string.m	29 Jun 2001 03:30:27 -0000	1.146
+++ string.m	25 Jul 2001 15:46:22 -0000
@@ -1939,9 +1939,14 @@
 }").
 
 :- pragma foreign_proc("MC++",
-	string__append_ioi(_S1::in, _S2::out, _S3::in),
+	string__append_ioi(S1::in, S2::out, S3::in),
 		[will_not_call_mercury, thread_safe], "{
-	mercury::runtime::Errors::SORRY(""c code for this function"");
+	if (S3->StartsWith(S1)) {
+		S2 = S3->Remove(0, S1->Length);
+		SUCCESS_INDICATOR = TRUE;
+	} else {
+		SUCCESS_INDICATOR = FALSE;
+	}
 }").
 
 :- pred string__append_iio(string::in, string::in, string::out) is det.

--------------------------------------------------------------------------
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