[m-rev.] for review: allow sized integers as format arguments

Zoltan Somogyi zoltan.somogyi at runbox.com
Tue Nov 10 00:00:16 AEDT 2020


2020-11-09 22:16 GMT+11:00 "Julien Fischer" <jfischer at opturion.com>:
> Java and .NET are not dying platforms by any stretch of the imagination.
> (Mercury int's are 32-bit on both of those platforms.)

Ah, I always forget that those languages chained themselves to
a sinking ship :-(

> I don't like this suggestion anyway, since I've been trying to avoid
> having builtin types that are second class citizens (e.g. like unsigned
> integer types in C#).

I agree with that principle.

> For now, I suggest going with your third option above and change
> format_cast_int64_to_int etc to check if the platform is 32-bit and
> abort if it is. 

The attached code does this. I will commit the whole thing once you review it.

> Supporting 32-bit platforms properly shouldn't be
> too difficult, but will require further additions -- I can look into
> that if you like.

Please do.

>>> The documentation directly below this type declaration (for string.format) should
>>> also be updated.
>>
>> I can do this by
>>
>> - adding a note such as "the valid conversion specifiers for int{8,16,32,64},
>>  are the same as for int", and likewise for uint,
> 
> That seems fine.

Will do.

Zoltan.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: abort
Type: application/octet-stream
Size: 1705 bytes
Desc: not available
URL: <http://lists.mercurylang.org/archives/reviews/attachments/20201110/a7c3fae6/attachment.obj>


More information about the reviews mailing list