[mercury-users] csharp double in defined types

Jeff Thompson jeff at thefirst.org
Thu Jan 19 16:58:46 AEDT 2012


On 1/16/2012 11:08 PM, Peter Wang wrote:
> On Mon, 16 Jan 2012 13:18:35 -0800, Jeff Thompson<jeff at thefirst.org>  wrote:
>> If I wanted to look at modifying
>> the compiler to output "ref bool commit", which source code files would
>> I start with?
> mlds.m and the ml*.m files.  In particular note the comment at the top
> of ml_commit_gen.m which seems to be what you are suggesting.

Thanks for that.  I'll take a look.  I have a new question about the C# 
output:

When a defined type has a float, the C# structure uses object instead of 
double to store it (see "generic type" below).  Is there a way to get 
the compiler to use double directly, so that the runtime does not have 
to box/unbox from object?

:- type myFloat ---> myFloat(float).

C# output:

public class MyFloat_0
   {
     public /* generic_type */ object F1;

     public MyFloat_0(
       /* generic_type */ object F1)
     {
       {
         this.F1 = F1;
       }
     }
   }

Thank you,
- Jeff




--------------------------------------------------------------------------
mercury-users mailing list
Post messages to:       mercury-users at csse.unimelb.edu.au
Administrative Queries: owner-mercury-users at csse.unimelb.edu.au
Subscriptions:          mercury-users-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the users mailing list