[m-dev.] For review: Add implementation of reference types (global heap)

David Glen JEFFERY dgj at cs.mu.OZ.AU
Wed Jun 10 16:20:16 AEST 1998


On 10-Jun-1998, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> On 10-Jun-1998, Peter Schachte <pets at students.cs.mu.oz.au> wrote:
> > And, of course, avoid that bug such definitions tickle in
> > the Mercury compiler. ;-)
> 
> Incidentally, that bug is no longer a bug, it's now just a missing feature ;-)
> That is, the compiler reports "Sorry, not implemented", rather than
> generating incorrect code.
> 
> 	bash$ mmc -E a.m
> 	a.m:004: Sorry, not implemented: polymorphic equivalence type,
> 	a.m:004:   with monomorphic definition, exported as abstract type.
> 		A quick work-around is just export the type as a concrete type,
> 		by putting the type definition in the interface section.
> 		A better work-around is to use a "wrapper" type, with just one
> 		functor that has just one arg, instead of an equivalence type.
> 		(There's no performance penalty for this -- the compiler will
> 		optimize the wrapper away.)

Personally, I'm not convinced that we should allow polymorphic equivalence
types with monomorphic definitions at all. I don't think that the "equivalence"
makes sense. Of course, it all depends upon how you interpret "equivalence".

OTOH, we probably need to allow it for backwards compatability. :-(


love and cuddles,
dgj
-- 
David Jeffery (dgj at cs.mu.oz.au) |  Marge: Did you just call everyone "chicken"?
MEngSc student,                 |  Homer: Noooo.  I swear on this Bible!
Department of Computer Science  |  Marge: That's not a Bible; that's a book of
University of Melbourne         |         carpet samples!
Australia                       |  Homer: Ooooh... Fuzzy.



More information about the developers mailing list