[m-dev.] for review: last call modulo constructors [1/3]

David Matthew Overton dmo at students.cs.mu.OZ.AU
Wed Jun 24 17:12:29 AEST 1998


On Wed, Jun 24, 1998 at 11:00:55AM +1000, Andrew Bromage wrote:
> 
> > +		( Mode = top_in ; Mode = ref_in )
> 
> > +		( Mode = top_out ; Mode = ref_out )
> 
> These patterns happen a lot.  I'm wondering if it might be worth making
> an predicate to do this test in case more modes are added.  Is that
> likely to happen?  Would free(aliased_many) require a new mode, for
> example?

It probably would require a couple of new modes, or at least an
argument for ref_in and ref_out.  I'll add some test predicates for
the arg_mode type.

> 
> > +:- pred code_exprn__remove_rval_from_lvals(rval, set(lval), set(lval)).
> > +:- mode code_exprn__remove_rval_from_lvals(in, in, out) is det.
> > +
> > +code_exprn__remove_rval_from_lvals(Rval, Lvals0, Lvals) :-
> > +	( Rval = lval(Lval) ->
> > +		set__delete(Lvals0, Lval, Lvals)
> > +	;
> > +		Lvals = Lvals0
> > +	).
> 
> Should the `else' case be a call to error/1 here?

Hmm.  Actually that predicate is no longer used.  Perhaps I'll just
remove it.

-- 
David Overton
MEngSc Student                       Email: dmo at cs.mu.oz.au     
Department of Computer Science       Web: http://www.cs.mu.oz.au/~dmo
The University of Melbourne          Phone: +61 3 9344 9159



More information about the developers mailing list