[m-dev.] for review: direct reuse

Fergus Henderson fjh at cs.mu.OZ.AU
Thu Sep 21 11:42:01 AEDT 2000


On 20-Sep-2000, Peter Ross <Peter.Ross at cs.kuleuven.ac.be> wrote:
> +++ ml_unify_gen.m	2000/09/20 11:16:50	1.16.2.1
> @@ -984,8 +979,33 @@
>  		{ MLDS_Decls = list__append(BoxConstDefns, [ConstDefn]) },
>  		{ MLDS_Statements = [AssignStatement] }
>  	;
> -		{ HowToConstruct = reuse_cell(_) },
> -		{ sorry("cell reuse") }
> +		{ HowToConstruct = reuse_cell(CellToReuse) },
> +		{ CellToReuse = cell_to_reuse(ReuseVar, ConsId, _CorrectVals) },
> +
> +		%
> +		% Currently structure reuse will only reuse a cell that
> +		% is using the same cons_id, so it is safe to just do an
> +		% assignment.
> +		%
> +		ml_gen_unification(assign(Var, ReuseVar), model_det, Context,
> +				MLDS_Decls, MLDS_StatementsA),

That is a somewhat fragile assumption.  I think it would be a very
good idea to document that the MLDS back-end relies on this assumption
in the definition of the reuse_cell/1 constructor in hlds_goal.m.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
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