[m-rev.] diff: string__sub_string_search in MC++
Peter Ross
peter.ross at miscrit.be
Thu Jul 26 02:04:42 AEST 2001
Hi,
===================================================================
Estimated hours taken: 0.5
Branches: main
library/string.m:
Implement string__sub_string_search in MC++.
Implement string__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 16:02:47 -0000
@@ -1072,10 +1072,10 @@
}").
:- pragma foreign_proc("MC++",
- string__sub_string_search(_WholeString::in, _SubString::in,
- _Index::out) , [will_not_call_mercury, thread_safe],
+ string__sub_string_search(WholeString::in, SubString::in,
+ Index::out) , [will_not_call_mercury, thread_safe],
"{
- mercury::runtime::Errors::SORRY(""c code for this function"");
+ Index = WholeString->IndexOf(SubString);
}").
%-----------------------------------------------------------------------------%
@@ -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