>       What do the following definitions do:
>
>1      x + 1 = f x
>
>2      (x + 1) = f 2
>
>I don't propose to change this, because in practice it doesn't seem
>to cause much of a problem, but it seems pretty confusing.  To my mind
>the culprit is clear: n+k patterns.  But they are staying in Haskell 98.

I've simplified the problem by dropping two alternatives - I'll tweak 1
above  little, to give 1`  - lets write these together again

1`    x + 1  = f 2
2    (x + 1) = f 2

Now,
>(1`) partially defines (+).
>(2) is a pattern binding that binds x.

Ho-hum - the only difference between these two pieces of concrete syntax
is that one wraps  construct ("x + 1") in parentheses, the other doesn't.

Parentheses are usually used in mathemtaica and programming notations
as a syntactical guide to the parsing of expression - a form of hinting
regarding the desired underlying abstract syntax, or parse tree.

IMHO (which of course is never humble :-)  the real problem here,
that causes most of the confusiuon, is that THESE parentheses  (2 above)
have different semantics - leave them out and we partiall define (+),
put them in and we pattern bind x

I don't care about n+k patterns one way or another - I am a lazy functional
programmer and will happily write 'n' instead of 'n+1' wherever that will
do :-)

I think the real confusion here is the semantic role being played by symbols
that are traditionally used as syntactical structure indicators.

-------------------------------------------------------------
Andrew Butterfield,                           Location: LG.19
Dept. of Computer Science,               Tel: +353-1-608-2517
O'Reilly Institute,                      Fax: +353-1-677-2204
Trinity College,
Dublin 2, IRELAND.        mailto:[EMAIL PROTECTED]
URL:                 http://www.cs.tcd.ie/Andrew.Butterfield/



Reply via email to