Commit Graph

4 Commits

Author SHA1 Message Date
Zoltan Somogyi
8e45a89895 Use spaces, not tabs, in the Java and C# runtimes.
Add modelines to keep it that way.

Fix formatting, and english in comments.
2018-07-10 13:52:11 +02:00
Mark Brown
d465fa53cb Update the COPYING.LIB file and references to it.
Discussion of these changes can be found on the Mercury developers
mailing list archives from June 2018.

COPYING.LIB:
    Add a special linking exception to the LGPL.

*:
    Update references to COPYING.LIB.

    Clean up some minor errors that have accumulated in copyright
    messages.
2018-06-09 17:43:12 +10:00
Ian MacLarty
6aea768459 Override Object#equals for Mercury enumerations in the Java grades
Estimated hours taken: 2
Branches: main

Override Object#equals for Mercury enumerations in the Java grades
and document that this should be used for equality testing in Java
code.  The problem with using == is that instances might not have
the same addresses if they are serialized and then deserialized.

MercuryEnum is now a class and not an interface.

compiler/ml_type_gen.m:
    Inherit the MercuryEnum class in Mercury enumerations
    instead of implementing the MercuryEnum interface.

compiler/mlds_to_java.m:
    Don't output the MR_value member in Java classes that correspond to
    Mercury enumerations.  This member is now inherited from MercuryEnum.

    Don't mangle classes in the Mercury runtime.

doc/reference_manual.texi:
    Document that the equals method should be used for exported
    Mercury enumerations.

java/runtime/MercuryEnum.java:
    Make MercuryEnum a class and implement the equals method.

    Also implement the hashcode method.
2009-09-22 07:16:38 +00:00
Peter Wang
dfca5e04f0 Make Java classes corresponding to Mercury types automatically serialisable.
Branches: main

Make Java classes corresponding to Mercury types automatically serialisable.

java/runtime/MercuryType.java:
        Make MercuryType extend java.io.Serializable.

compiler/mlds_to_java.m:
java/runtime/MercuryEnum.java:
        Add a MercuryEnum interface which is implemented by classes
        corresponding to Mercury enumerations.  Previously enumerations
        didn't implement MercuryType.

compiler/ml_type_gen.m:
        Make enumeration classes implement MercuryType and MercuryEnum.

library/builtin.m:
        Make builtin.copy check for MercuryEnum instead of relying on
        enumeration classes not to implement MercuryType.  This is not
        strictly necessary but avoids copying instances of enumeration
        classes.
2009-07-09 05:18:08 +00:00