[m-dev.] polymorphic modes

Ralph Becket rbeck at microsoft.com
Wed Feb 9 23:16:41 AEDT 2000


> > > What happens if you call p/1 with a arguments whose
> > > initial insts are `(unique, free)'?  Does that end
> > > up calling the `p(in(ground), out(ground))' mode,
> > > or is it a mode error?
> > > 
> > 
> > The former.
> 
> Is this desireable?
> I think at the very least there should be a warning, letting 
> you know that
> the uniqueness has been slaughtered. Otherwise, I can imagine 
> some major
> pain being caused because of this... I found uniqueness hard enough to
> grasp initially as it is :)

I think this is all right since mode analysis will tell you
when you end up calling something with a ui/di mode after
uniqueness has been lost.

Losing uniqueness can be something you want to do.  For example,
I might create an array and then pass it around as a non-unique
vector - all I give up is the ability to update the vector, which
is also what I want.

Ralph
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list