[m-dev.] for review: prelim support for hash consing
David Glen JEFFERY
dgj at cs.mu.OZ.AU
Thu Aug 26 14:36:30 AEST 1999
On 25-Aug-1999, Zoltan Somogyi <zs at cs.mu.OZ.AU> wrote:
>
> I think the format of the error message is irrelevant, because the pragma
> should be such that there is no ambiguity. The design I discussed with Fergus,
> which his original mail mentioned, had two kinds of pragmas:
>
> :- pragma hash_cons(typector/arity)
> :- pragma hash_cons(typector/arity, [ctor1/arity1, ctor2/arity2, ...])
This isn't what Pete has implemented. The pragma he has implemented is:
:- pragma memo_cons(ctor/arity).
ie. it specifies a constructor, not a type ctor. Should that be fixed?
> >> The mangled name could maybe be a little more robust... I'm not sure what,
> >> though.
>
> I thought we decided that the best approach would be to reserve a character
> ('_', or '$' or ...) so that only compiler-created predicates can start
> with that character. User-created predicates whose names start with that
> character (names which must be quoted) would then have another character
> inserted at the front by the compiler. Implementing this system would seem
> to me to be a job best done by Fergus, or possibly Simon.
Sounds like a good idea. It would be nice, though, to have a hierarchical
scheme to ensure that we don't stand on each other's toes: eg.
$hash_cons$foo_3_whatever
$typeclass$myclass_3_something
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