Newsgroups: comp.lang.python,comp.lang.tcl,comp.lang.scheme,comp.lang.misc,comp.lang.perl
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!news.mathworks.com!udel!gatech!howland.reston.ans.net!vixen.cso.uiuc.edu!uchinews!news
From: Charles Fiterman <cef@geodesic.com>
Subject: Re: Comparing syntaxes  (Re: What language would you use?)
Message-ID: <1994Nov11.144913.7481@midway.uchicago.edu>
Sender: news@uchinews.uchicago.edu (News System)
Organization: Geodesic Systems
References: <39b7ha$j9v@zeno.nscf.org> <39pel5$qls@brachio.zrz.tu-berlin.de> <id.6ALE1.TW6@nmti.com> <39umpu$k1b@larry.rice.edu>
Date: Fri, 11 Nov 1994 14:49:13 GMT
Lines: 25
Xref: glinda.oz.cs.cmu.edu comp.lang.python:2587 comp.lang.tcl:21702 comp.lang.scheme:11163 comp.lang.misc:19040 comp.lang.perl:38643

I would like to show a more general alternative to operator
presidence, binding strength. The idea is that each parameter
(and operator arguments are really parameters) has a binding
strength. When two functions fight over a parameter the one
with the higher binding strength wins. Thus an operator like
colon : can bind strongly to the left and weakly to the right.
it also eliminates the need to have functions followed by
parens. You can say sqrt x instead of sqrt(x). sqrt x * y
will work as sqrt(x * y) since * has higher binding strength
than the default for functions. This can be changed in the
definition of sqrt.

Binding strength replaces associativity as a way of grouping
operators. Thus we are replacing two concepts presidence and
associativity with one binding strength. Further this allows
the definition of new operators by the user. The real problem
with that in other languages is that you must give the presidence
and associativity of the new operator.

The problem with this is the binding strengths are numbers in
a range so slipping in new ones can be ugly. This seems to
be a poor encapsulation that I don't see how to get around.



