[M3devel] what to do about file sizes being 32bits?

Rodney M. Bates rodney_bates at lcwb.coop
Fri Jan 8 17:49:06 CET 2010



Jay K wrote:
> I don't believe currently "10" is assignable
> (or comparable) to LONGINT.
> You have to use 10L.

This is a bit subtle, and I should have been more explicit.  I didn't
mean the Modula-3 expression "10", I meant just the value ten.

 From 2.2:
------------------------------------------------------------------------------
Every expression has a unique type, but a value can be a member of many types.
For example, the value 6 is a member of both [0..9] and
INTEGER.  It would be ambiguous to talk about ``the type of a value''.
Thus the phrase ``type of x'' means ``type of the expression
x'', while ``x is a member of T'' means ``the value of
x is a member of T''.
------------------------------------------------------------------------------

The snippets of Modula-3 _code_ "10" and "10L"  are expressions.  Each has
both a value (which is the same) and a type (which is different).  The value
10 is a member of both types.

The 2.2 quote was written before we had LONGINT and its literals, so referring to
the value 6 wasn't as unclear.  Maybe it would be better to say that the
value 10 when stored in an INTEGER is a different abstract value than
10 stored in a LONGINT.  Then the two types would have disjoint value
sets.  But I think that would be a serious contradiction to the way
subranges work.

>  
>  
> I do believe any INTEGER or CARDINAL expression should be assignable
> to LONGINT, but I don't think it is implemented that way currently.
>  
>  
> And, then, I wonder if subranges are all we need, no LONGINT.
> But I don't understand the language well enough.
>  
>  
>  - Jay
> 



More information about the M3devel mailing list