[m-rev.] for review: mlds_to_{cs,java}_type.m

Julien Fischer jfischer at opturion.com
Thu May 4 00:36:59 AEST 2023


Hi Zoltan,

On Thu, 4 May 2023, Zoltan Somogyi wrote:

>
> 2023-05-03 03:26 GMT+10:00 "Zoltan Somogyi" <zoltan.somogyi at runbox.com>:
>> For review by anyone.
>
> In the absence of a review by then, I intend to commit this diff this evening.

I have started reviewing this one -- one comment below; I won't have
time to continuing looking at this until at least the weekend, so feel
free to commit it.

Julien.

> diff --git a/compiler/mlds.m b/compiler/mlds.m
> index f555b7530..f195263f6 100644
> --- a/compiler/mlds.m
> +++ b/compiler/mlds.m
> @@ -1016,9 +1016,28 @@
>              % The representations of the builtin types in the target language.
>              %
>              % Note that some target languages do not have types corresponding
> -            % *exactly* to each Mercury builtin type. For these, we generate
> -            % the closest type available in the target language, e.g. "int"
> -            % for mlds_builtin_type_int(int_type_uint) in Java.
> +            % *exactly* to each Mercury builtin type; for example, Java has
> +            % not unsigned types. For these, we use the closest type available.

s/not/no/

> +            %
> +            % The following table shows the target language types we use
> +            % to represent each of the above builtin types in the three
> +            % MLDS target languages:
> +            %
> +            % Mercury type      C           Java        C#
> +            %
> +            % int               MR_Integer  int         int
> +            % uint              MR_Unsigned int         uint
> +            % int8              int8_t      byte        sbyte
> +            % uint8             uint8_t     byte        byte
> +            % int16             int16_t     short       short
> +            % uint16            uint16_t    short       ushort
> +            % int32             int32_t     int         int
> +            % uint32            uint32_t    int         uint
> +            % int64             int64_t     long        long
> +            % uint64            uint64_t    long        ulong
> +            % float             MR_Float    double      double
> +            % char              MR_Char     int         int
> +            % string            MR_String   j.l.String  string
>
>      ;       mlds_native_bool_type
>              % The representation of booleans in the MLDS target language.


More information about the reviews mailing list