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

Mark Brown mark at mercurylang.org
Tue May 17 13:26:40 AEST 2016


On Tue, May 17, 2016 at 11:15 AM, Zoltan Somogyi
<zoltan.somogyi at runbox.com> wrote:
> On Mon, 16 May 2016 20:16:58 +1000, Paul Bone <paul at bone.id.au> wrote:
>> Rather than making standard library
>> modules privileged (assuming we want to do that), we can introduce a pragma
>> to say "I want to use fancy symbols in this module" then people writing such
>> modules, including standard library modules, can declare that pragma
>> knowing that they may get less-friendly error messages.  This makes such
>> symbols available to user's programs and still enables the vast majority of
>> code to be compiled with friendlier error messages.
>
> I like this.

I don't. For one thing, you've already convinced me that the
flexibility of being able to use such symbols is of little value. I
also don't like that I can be looking at a screenful of code while the
declarations that tell me how to parse what I'm looking at could be
thousands of lines away.

How does it work with the module system? If you import a module with
this pragma do you have to declare the pragma yourself to use the
symbols? Or do you lose good error messages?

Seems like the worst of both worlds to me, at least for people who are
reading or using code rather than writing it.

> A further advantage you did not list is that it tells people who
> unintentially name things after keywords that their choice has consequences
> for later error messages;

That's not really an advantage, because prohibiting these names also
tells people that their choice has consequences.

Mark


More information about the reviews mailing list