[m-rev.] for review: do not allow (mostly-)unique or free mutables

Julien Fischer juliensf at csse.unimelb.edu.au
Tue Oct 3 14:03:47 AEST 2006


On Mon, 25 Sep 2006, Julien Fischer wrote:

> Estimated hours taken: 2
> Branches: main
>
> Restrict the insts that are allowed to appear in mutable declarations. In 
> particular mutables are now no longer allowed to have the insts
> (mostly-)unique or free.
>
> doc/reference_manual.texi:
> 	The inst in a mutable should not be, nor should it contain components
> 	that are, unique, mostly_unique, free, dead or mostly_dead.  For
> 	most of these it doesn't actually make a lot of sense and for some
> 	of them, e.g. mostly_unique mutables, the code we currently generate
> 	for mutables ends up being mode incorrect.
>
> 	XXX If we supported partial instaniation then it might make sense
> 	for mutables to have insts that contain free components but we'll
> 	cross that bridge when we come to it.
>
> 	Reword the restriction on typeclass constraints on mutables; as
> 	written it looks like the typeclass constraints are being applied to
> 	the inst variables.
>
> compiler/hlds_code_util.m:
> 	s/hlds/HLDS in a comment.
>
> 	Add a predicate that tests if an inst is valid inst for a mutable
> 	declaration.
>
> compiler/make_hlds_passes.m:
> 	Check that the inst in a mutable declaration conforms to the above
> 	rules and emit an error message if it does not.
>
> 	Turn an if-then-else into a switch.
>
> 	Fix an overlong line.
>
> compiler/prog_mode.m:
> 	Fix some formatting.
>
> tests/invalid/Mmakefile:
> tests/invalid/uniq_mutable.{m,err_exp}:
> 	Test case for the above.

I will commit this change later today unless anyone is planning to
review it.

Julien.
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list