[m-rev.] for review: better error messages for lambda exprs

Paul Bone paul at bone.id.au
Wed May 11 21:03:42 AEST 2016


On Wed, May 11, 2016 at 12:38:48PM +1000, Mark Brown wrote:
> On Wed, May 11, 2016 at 12:11 PM, Paul Bone <paul at bone.id.au> wrote:
> > Philosophically I support making Mercury easier to use, especially for new
> > developers.
> 
> I can't tell what you mean by "easier to use". Do you mean that if the
> set of legal programs is restricted, the language is harder to use?

If the compiler tells the developer more directly what is wrong with their
program, then the compiler is easier to use.  Both Zoltan and Peter's
proposals offer this.

> > I support the change, I would also be happy with Peter's alternative of
> > providing a hint to developers in the error messages involving these
> > symbols.
> 
> Can you give an example of what the hints would look like?

IT is Peter's suggestion, so I'm just guessing what he meant.

If the compiler creates a type error for a term involving a :- which is not
a lambda expression, then in addition to the usual type error the compiler
could print something like "Perhaps this is a malformed lambda expression."
to tell the programmer why the compiler got confused.


-- 
Paul Bone


More information about the reviews mailing list