Oz and Mozart Hackers Mailing List

Re: '#'(X,Y)=Z


From: Raphael Collet (raph@info.ucl.ac.be)
Date: Wed Jan 16 2002 - 14:49:59 CET


Luis Quesada wrote:

> That's exactly my point: Is it possible to * constraint * Y in such a way that
> '#'(X,Y)=Z be a valid statement? I know that Y should be replaced by something like
> a($) , but that's beside the point. My point is that '#'(X,Y)=Z is a syntax error
> because a variable cannot occur in the position where Y does. Am I wrong?

A variable may occur at this position. The following example, even not
good programming practice, is syntactly valid:

        meth foo
           Y in X,Y
        end

An experienced user, having a look at the code and the error message,
understands that the compiler had considered the expression X,Y as a
nested object application. However, everyone should agree that the
compiler error messages must signal errors AND give some hints to the
programmer in order to understand where the bug comes from. I think
nobody would complain if the message was a bit more explicit, like:

        In nested object application: X,Y

        the message must contain exactly one nesting marker.

Of course, it is said that the problem is at "line 4, column 11", but I
personally never navigate in a program *only* by looking at line and
column number. We could be much more productive if the compiler gives
us more visual hints in error messages.

PS: I won't propose myself for improving the error messages :-) I am
currently in lack of time. Sorry.

Cheers,

-- 
Raphaël Collet - raph@info.ucl.ac.be - http://www.info.ucl.ac.be/~raph/
-
Please send submissions to hackers@mozart-oz.org
and administriva mail to hackers-request@mozart-oz.org.
The Mozart Oz web site is at http://www.mozart-oz.org/.



This archive was generated by hypermail 2b29.