[mercury-users] mode error

Fergus Henderson fjh at cs.mu.OZ.AU
Wed Jun 12 15:08:23 AEST 2002

On 12-Jun-2002, David Overton <dmo at cs.mu.OZ.AU> wrote:
> On Wed, Jun 12, 2002 at 01:50:40PM +1000, Michael Day wrote:
> > 
> > Thought I might share this mode error with the world, seeing as it's so
> > impressive.
> > 
> > What do 'shared' and 'fake' mean?
> Let me interpret a portion of this for you:
> 	list:list_skel((pdf:object))
> is a user-defined inst.
> 	$typed_inst((list:list((pdf:object))), list:list_skel((pdf:object)))
> is the same inst with information added about the type of the object in
> question, `list:list((pdf:object))' in this case.
> 	$ground($typed_inst((list:list((pdf:object))),
> 			list:list_skel((pdf:object))), dead, shared, fake)
> is a name that represents the inst obtained by doing a "fake"
> unification between the previous inst and `ground'.
> The inst `list_skel(object)' has a recursive definition so the inst resulting
> from a unification between it and ground is also recursive.  Therefore,
> to refer to it finitely, we give it a name (as shown above) which is
> referred to using the `$ground(...)' construct.  Note that these "names"
> are only used internally by the compiler and in the not-so-helpful error
> messages, you can't actually use them in your source code.

For the error messages, what the compiler really ought to do is
to expand these recursive insts out, up to the point at which
they start to repeat, at which point it should print out "...".
That way, the user will see what they need to see,
not the internal names used by the compiler.

This would probably not be difficult to implement.

We should also make use of the pretty-printer when outputting inst names,
so that long and complicated insts get indented nicely.

Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe

More information about the users mailing list