[m-rev.] diff: foreign export bool for java

Julien Fischer juliensf at csse.unimelb.edu.au
Tue Aug 11 14:16:57 AEST 2009


On Tue, 11 Aug 2009, Peter Wang wrote:

> Branches: main
>
> library/bool.m:
>        Export `bool' enumeration values for Java foreign code.
>
> diff --git a/library/bool.m b/library/bool.m
> index a620e98..f997bfb 100644
> --- a/library/bool.m
> +++ b/library/bool.m
> @@ -77,6 +77,12 @@
> % The representation of bool values should correspond with the definitions of
> % MR_TRUE and MR_FALSE in runtime/mercury_std.h.
>
> +:- pragma foreign_export_enum("Java", bool/0, [],
> +    [
> +        no  - "ML_NO",
> +        yes - "ML_YES"
> +    ]).
> +

For consistency with the C version perhaps they should be called MR_NO
and MR_YES?  (Or at least add a second foreign_export_enum pragma that
uses those names.)

You should also update the Java data passing conventions section of the
reference manual.  (You may as well add the foreign export for
builtin.comparison_result that the C grades have as well).

Cheers,
Julien.
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list