[m-dev.] syntax proposals

Ralph Becket rafe at cs.mu.OZ.AU
Mon Nov 19 14:45:18 AEDT 2001


Fergus Henderson, Friday, 16 November 2001:
> On 07-Nov-2001, Ralph Becket <rafe at cs.mu.OZ.AU> wrote:
> > One thing that I find aesthetically distressing is that we currently
> > have different syntax for declarations at the top-level and for nested
> > declarations such as with typeclass and instances.
> > 
> > This stems from using lists to group nested declarations and
> > definitions.  Can we introduce a different kind of `list' for this
> > purpose which perserves the top-level syntax.
> 
> That would be techically feasible, yes.
> 
> One complication would be that the parser might have to
> do a smarter job of error recovery.  Currently we just
> use the very simple algorithm of skipping to the next
> item, but once you have significant nesting outside the
> items, then that strategy can lead to a whole swathe of
> spurious errors if e.g. a nesting terminator is accidentally
> omitted.
> 
> Of course, we have that problem with nested modules already.

True - this sort of thing usually leads to an "infinite string of
errors" which many programmer's will recognise as an indication of a
missing terminator.

- Ralph
--------------------------------------------------------------------------
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