X-Comment1: #############################################################
X-Comment2: #     uk.ac.glasgow.cs has changed to uk.ac.glasgow.dcs     #
X-Comment3: #     If this address does not work please ask your mail    #
X-Comment4: #     administrator to update your NRS & mailer tables.     #
X-Comment5: #############################################################


Folks

Here's another V1.1 typo

Simon

------- Forwarded Message

Date:    Fri, 04 Oct 91 12:24:47 -0700
From:    [EMAIL PROTECTED]
To:      Simon L Peyton Jones <simonpj>
cc:      Mikael Rittri <[EMAIL PROTECTED]>
Subject: Re: bug in lex {PreludeText}



| Date:    Fri, 27 Sep 91 16:29:11 +0100
| From:    Mikael Rittri <[EMAIL PROTECTED]>
| To:      haskell
| Subject: bug in lex {PreludeText}
|
| There is a bug in the lex function (PreludeText, appendix A7).
|
| Since '-' now is valid as the first symbol of an operator, it 
| follows that e.g. "->>" is an operator, even though "->" is 
| reserved (page 8).   But the clause (page 110, line -13) 
|
|    lex ('-':'>':s) = [("->",s)] 
|
| will make lex cut off the "->" part, rather than follow 
| the longest-lexeme rule.  

Mikael is right; this is an overlooked vestige of an earlier more
severe lexical syntax of operators.  The fix is to delete the line
in question from the definition of lex.  The next line in the definition,
however,

        lex ('<':'-':s) = [("<-",s)]

must remain, because <- is a special lexeme that doesn't look
like an operator.  There is a trap here for the unwary, in fact:

        x>-3

is an expression, but

        x<-3

is not.

- --Joe

------- End of Forwarded Message


Reply via email to