[M3devel] the LONGINT proposal
Tony Hosking
hosking at cs.purdue.edu
Mon Jan 11 18:42:34 CET 2010
We have Word.T and Long.T to handle masking the higher-order bits.
On 11 Jan 2010, at 11:23, hendrik at topoi.pooq.com wrote:
> On Mon, Jan 11, 2010 at 12:14:06PM +0000, Jay K wrote:
>>
>> There is some disagreement floating around apparently on even what
>> to call the INTEGER <=> LONGINT conversions.
>> Currently ORD converts to INTEGER.
>> Randy's proposal I believe converts to the underlying type: INTEGER or LONGINT.
>> And I think uses VAL(expr, INTEGER or LONGINT) to convert to INTEGER or LONGINT.
>>
>>
>> I believe I saw a proposal that the converesions be named after the type:
>> INTEGER(expr), LONGINT(expr).
>>
>> That kind of smacks to me of "too hard to search for".
>>
>> Here is a crazy verbose suggestion:
>> LOOPHOLE(integer or subrange or enumeration or longint, INTEGER or LONGINT)
>>
>> and allow it in safe modules?
>> At least it is existing syntax with roughly the desired meaning,
>> except that LOOPHOLE is and sounds unsafe.
>>
>> CAST(expr, type)
>> CONVERT(expr, type)
>> ?
>>
>> I'm just making up words here of course.
>> VAL or ORD seem sufficient, esp. if you can specify the type.
>
> NARROW? WIDEN?
>
> And TRUNCATE if you really want to chop off the high-order bits without
> overflow check?
>
> -- hendrik
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20100111/dc4d31ac/attachment-0002.html>
More information about the M3devel
mailing list