[M3devel] Unbounded but finite LONGINT

Tony Hosking hosking at cs.purdue.edu
Sat Jan 9 21:21:43 CET 2010


On 9 Jan 2010, at 14:50, Rodney M. Bates wrote:

> Tony Hosking wrote:
>> On 8 Jan 2010, at 20:33, hendrik at topoi.pooq.com <mailto:hendrik at topoi.pooq.com> wrote:
>>> On Fri, Jan 08, 2010 at 07:53:07PM -0500, Tony Hosking wrote:
>>>> I think what you are advocating is Rodney's proposal + assignability
>>>> of INTEGER and LONGINT + mixed arithmetic.
>>> 
>>> I thought Rodney's propsal still had the compiler impose a bound on the
>>> size of LONGINT.  Or did I miss something?
>> Yes, it would.
>>> I'm proposing to let the programmer use subranges of LONGINT that are as
>>> long as he wishes.  And if the computer runs out of virtual memory to
>>> store one of the programmer's long integers, well, that's the computer
>>> imposing the limit, not the language.
>> But there is still the question as to what *representation* is used to decide the particular operation to apply.
>> I suppose the compiler could choose a particular machine representation based on the range of values in the subrange (much as it does currently).
>> But if you really want to have an arbitrary range type I would argue it is much better to implement it as a library than as a primitive type.
> 
> This I agree with wholeheartedly.  Don't we already have some math libraries
> for things like this, or maybe rational arithmetic, etc?

Yes, the arithmetic package (m3-libs/arithmetic).


More information about the M3devel mailing list