[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problems with 64-bit numbers



>  Date: Thu, 9 May 96 06:51:47 EDT
>  From: Mike Griebling <grieblm@trt.allied.com>
>  
>  > You probably want the whole circus of set operations defined on the
>  > new types, too?  Like union, intersection, difference, symmetrical
>  > difference, complement, test for membership, test if equal, test if
>  > not equal, include, exclude, MIN, and MAX?
>  
>  Yes.  :-)

I missed one important feature in the list: set constant constructors.
The standard constructor "{...}" builds a value of type SET.  But how
are constants of type SET8 or SET16 defined?

One way to do this is to add a Modula-2 like set constructor,
e.g. writing SET8{0,4}.  But this would mean to extend the syntax,
which I don't like at all.

Another way is to introduce implicit type conversion rules like the
ones applied to integer values, and translate set constants to the
smallest set type containing all given elements.  Comparing such
a constant with a variable of type SET (or assigning it to a SET)
would cause the compiler to insert a type conversion to the larger
type.  This means that the different set sizes are handled
transparently by the compiler, you wont know about this unless you
choose to.

My statement that I don't like implicit type conversion still stands.
On the other hand I'd like to have 8 and 16 byte sets for a simple
interface to C libs, e.g. X11.  Does anyone agree with the type
conversion scheme?

>  > >  I'm not so sure whether the HUGESET should also be
>  > >  declared in the SYSTEM module or built into the language.
>  > 
>  > If HUGEINT is a standard type, then HUGESET should be one, too.  I
>  > can't think of any reason why one of them should be declared standard,
>  > while the other is marked as system dependent.
>  
>  Ok, make it so -- when we finally have a 64-bit compiler.

Yes, the dicussion about 64 bit types is somewhat theoretically at the
moment.  The point is, such extensions have to be integrated into (or
at least planned for) the front-end as soon as possible.  As soon as
the ANSI-C back-end is done I'll put full support for 64 types into
the compiler.  Before that I can't test if all the relevant changes
were made to support 64 bit integer and set constants.

-- mva