mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-17 10:23:46 +00:00
Add some more code to the temporary, partial Java versions of the
Estimated hours taken: 4 Branches: main Add some more code to the temporary, partial Java versions of the Mercury library modules. This allows us to test the Java back-end on a few extra test cases and could help prevent regression errors. mercury/java/library/array.java: mercury/java/library/benchmarking.java: mercury/java/library/bintree.java: mercury/java/library/bintree_set.java: mercury/java/library/construct.java: mercury/java/library/dir.java: mercury/java/library/exception.java: mercury/java/library/lexer.java: mercury/java/library/math.java: mercury/java/library/parser.java: mercury/java/library/random.java: mercury/java/library/rtti_implementation.java: mercury/java/library/set_ordlist.java: mercury/java/library/set_unordlist.java: mercury/java/library/store.java: mercury/java/library/table_builtin.java: mercury/java/library/term_io.java: mercury/java/library/varset.java: Added these files. They are partial (or empty) versions of the Mercury library modules written in Java. mercury/java/library/bool.java: mercury/java/library/builtin.java: mercury/java/library/io.java: mercury/java/library/mr_int.java: mercury/java/library/private_builtin.java: mercury/java/library/std_util.java: mercury/java/library/string.java: Add additional code to these files.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// Copyright (C) 2002 The University of Melbourne.
|
||||
// Copyright (C) 2002-2003 The University of Melbourne.
|
||||
// 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.
|
||||
//
|
||||
@@ -9,5 +9,17 @@ package mercury;
|
||||
|
||||
public class string
|
||||
{
|
||||
public static java.lang.String append_3_p_2(java.lang.String s1, java.lang.String s2)
|
||||
{
|
||||
return s1.concat(s2);
|
||||
}
|
||||
|
||||
public static java.lang.Object [] append_3_p_1(java.lang.String s1, java.lang.String s2)
|
||||
{
|
||||
java.lang.Boolean success = new java.lang.Boolean(s2.startsWith(s1));
|
||||
java.lang.String answer = s2.substring(s1.length());
|
||||
java.lang.Object [] result = {(java.lang.Object) success, (java.lang.Object) answer};
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user