[m-rev.] for review: java enumerations

Julien Fischer juliensf at csse.unimelb.edu.au
Tue May 26 20:51:23 AEST 2009


On Tue, 26 May 2009, Julien Fischer wrote:

>
> On Tue, 26 May 2009, Peter Wang wrote:
>
>> On 2009-05-26, Julien Fischer <juliensf at csse.unimelb.edu.au> wrote:
>>> 
>>> In principle, there's no reason that `:- pragma foreign_enum' couldn't
>>> use Java enums in the java grade.  I certainly intended it to work with
>>> target languages that support stongly typed enumerations, i.e. not C
>>> style ones.
>> 
>> Can you explain?  From what I have read, you can't assign ordinal values
>> manually with Java enums.
>
> I wasn't assuming you would be able to assign ordinal values to them.
> Presumably, if whatever Java code you are trying to interface to use
> Java enums then it doesn't care about doing that anyway.

This all presupposes that the java grade has been changed to represent
Mercury enums as Java enums - since it currently doesn't do that it's
all hypothetical.  The point I was trying to get across was merely that
_if_ we decided to do that then pragma foreign_enum should be able to
support it.

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