[m-dev.] for review: prelim support for hash consing

David Glen JEFFERY dgj at cs.mu.OZ.AU
Wed Aug 25 17:18:49 AEST 1999


On 25-Aug-1999, Peter Ross <petdr at cs.mu.OZ.AU> wrote:
> > You should mention what this support is: you generate a pred to do the
> > construction unification for each hash_consed constructor. I guess that
> > the intention is to using tabling to get hash_consing for free. Is that
> > right? That is what I gather from the diff... and if so it needs to be
> > explained somewhere.
> > 
> This is just what zs asked me to implement, seeing I knew this bit of
> the compiler better then him and had some spare time.

I realise that, but you still need to explain what this commit is about in
the log message. Reading your diff, it isn't entirely clear where the
preds you are introducing fit into the scheme of things.

> > > +				{ module_info_incr_errors(Module0, Module) }, 
> > > +				prog_out__write_context(Context),
> > > +				io__write_string(
> > > +					"Error: export status mismatch.\n"),
> > 
> > This error message stinks.
> > 
> Any suggestions what to change it to?
> I couldn't think of a better message.

This is a user-visible error message, so it needs to mention:
	- that this error occurs because of the pragma memo_cons declaration
	- that it is the export status of the pragma and the type declaration
	  that differ. (However, `export status' may not be something that the
	  programmer is expected to know about... I'm not sure what other
	  error messages do. You may prefer to say `type declaration is visible
	  outside module but pragma is not' or something like that.

> That issue can be resolved by zs when he starts to use this code.

Fine.

> > Why don't you add it with the correct modes? You know it is (in, in, ..., out).
> 
> That is what modes functions default to anyway.

Oh, of course. Maybe add a comment saying so; anyone reading the code is bound
to ask the same question.

> > > +	% sym_name_to_term(SymName, Args, Term):
> > > +	%	convert a symbol name with an associated list of terms
> > > +	%	into a term.
> > > +:- pred prog_out__sym_name_to_term(sym_name, list(prog_term), prog_term).
> > > +:- mode prog_out__sym_name_to_term(in, in, out) is det.
> > 
> > Isn't there already something like this somewhere else?
> > 
> Not that I could find.

Does anybody else know of something similar.


dgj
-- 
David Jeffery (dgj at cs.mu.oz.au) | If your thesis is utterly vacuous
PhD student,                    | Use first-order predicate calculus.
Dept. of Comp. Sci. & Soft. Eng.|     With sufficient formality
The University of Melbourne     |     The sheerist banality
Australia                       | Will be hailed by the critics: "Miraculous!"
                                |     -- Anon.
--------------------------------------------------------------------------
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