|Problems with Hardware, Languages, and Compilers email@example.com (1997-03-07)|
|Re: Definable operators (was: Problems with Hardware, Languages, and C firstname.lastname@example.org (1997-03-13)|
|Re: Definable operators (was: Problems with Hardware, Languages, and C andy@cs.Stanford.EDU (1997-03-16)|
|Re: Definable operators Dik.Winter@cwi.nl (1997-03-18)|
|Re: Definable operators email@example.com.OZ.AU (1997-03-18)|
|Re: Definable operators firstname.lastname@example.org (1997-03-21)|
|Re: Definable operators email@example.com (Henry Spencer) (1997-03-22)|
|Re: Definable operators firstname.lastname@example.org (1997-03-23)|
|Re: Definable operators email@example.com (Tony Finch) (1997-03-23)|
|Re: Definable operators Dave@occl-cam.demon.co.uk (Dave Lloyd) (1997-03-27)|
|Re: Definable operators firstname.lastname@example.org (Henry Spencer) (1997-03-31)|
|Re: Definable operators email@example.com (1997-03-31)|
|[34 later articles]|
|From:||firstname.lastname@example.org (Nick Maclaren)|
|Date:||21 Mar 1997 10:10:53 -0500|
|Organization:||University of Cambridge, England|
|References:||97-03-037 97-03-051 97-03-076 97-03-112|
andy@cs.Stanford.EDU (Andy Freeman) writes:
>>Yes, I think that definiable operators are worse than poorly chosen
>>value reference names. Definable operators share the "what is that?"
>>property of poorly chosen names, but they also have a "what is it
>>operating on?" problem.
Fergus Henderson <email@example.com.OZ.AU> wrote:
>In languages such as Haskell and Prolog, which both allow alphabetic
>character sequences in operators, there is no reason why operators
>need have the "what is that?" property of poorly chosen names.
>And the "what is it operating on" problem is usually easily
>resolved by looking at the operator declaration.
I am afraid that isn't true if you allow user-defined association
properties (i.e. associativity, commutativity, priority and overloading).
In order to work out what is going on, the user must at least be able to
parse the expression, which is why Algol 68 had the priority a property
of the operator SYMBOL and not the operator DEFINITION.
The key is to add operator definitions in a limited, well-defined and
>>Frankly, I see no "large" potential benefits.
>Have you ever tried to write a combinator parser without using infix
It also makes certain programs (such as many numerical ones) a couple of
orders of magnitude easier to follow. Consider some of the statistical
and numerical formulae that take half a page of A4 in matrix notation.
And now write those without using matrix operators :-(
University of Cambridge Computer Laboratory,
New Museums Site, Pembroke Street, Cambridge CB2 3QG, England.
Tel.: +44 1223 334761 Fax: +44 1223 334679
Return to the
Search the comp.compilers archives again.