[mercury-users] Tagged datatypes and boxing

Peter Schachte schachte at cs.mu.OZ.AU
Mon Sep 27 16:16:59 AEST 1999


On Mon, Sep 27, 1999 at 01:48:24PM +1200, Zoltan Somogyi wrote:
> Peter Schachte <schachte at cs.mu.OZ.AU> wrote:
> > What about types involving pointers?  Here Mercury already does almost
> > as well as it can, allowing 4 or 8 constructors each with at most 1
> > address argument.  It could be improved a bit by allowing any number
> > of nilary constructors to share a single 2 or 3 bit tag in the low
> > bits, and then use the remaining bits to distinguish their values.

> In fact, the compiler was doing this from the very beginning of the project.

I stand corrected.  Mercury does about as well as possible, then, for
discriminated union types where at least one constructor has arguments
whose maximum size adds up to within a few bits of the word size.  For
"smaller" types, however, it does less well.

-- 
Peter Schachte                     ... we become automatons, replaceable
mailto:schachte at cs.mu.OZ.AU        parts in a vast industrial machine, made
http://www.cs.mu.oz.au/~schachte/  merely to run the machine until we
PGP: finger schachte at 128.250.37.3  ... run down. -- Stephan Rechtschaffen 
--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list