Re: Grammars for future languages

martelli@cadlab.it (Alex Martelli)
Sat, 4 Nov 1995 00:11:33 GMT

          From comp.compilers

Related articles
Grammars for future languages schinz@guano.alphanet.ch (1995-10-22)
Re: Grammars for future languages torbenm@diku.dk (1995-10-24)
Re: Grammars for future languages mfinney@inmind.com (1995-10-24)
Re: Grammars for future languages RWARD@math.otago.ac.nz (Roy Ward) (1995-10-26)
Re: Grammars for future languages wdavis@dw3f.ess.harris.com (1995-10-26)
Re: Grammars for future languages timd@Starbase.NeoSoft.COM (1995-10-30)
Re: Grammars for future languages jaidi@technet.sg (1995-11-09)
Re: Grammars for future languages martelli@cadlab.it (1995-11-04)
Re: Grammars for future languages schinz@guano.alphanet.ch (1995-11-05)
Re: Grammars for future languages ECE@dwaf-hri.pwv.gov.za (John Carter) (1995-11-07)
Re: Grammars for future languages mbbad@s-crim1.daresbury.ac.uk (1995-11-08)
Re: Grammars for future languages szilagyi@szilagyi.mit.edu (1995-11-09)
Re: Grammars for future languages davids@ICSI.Berkeley.EDU (1995-11-10)
Re: Grammars for future languages macrakis@osf.org (1995-11-10)
[6 later articles]
| List of all articles for this month |

Newsgroups: comp.compilers
From: martelli@cadlab.it (Alex Martelli)
Keywords: parse, design
Organization: Cad.Lab Spa, Bologna, Italia
References: 95-10-103 95-10-140
Date: Sat, 4 Nov 1995 00:11:33 GMT

"Roy Ward" <RWARD@math.otago.ac.nz> writes:
...
>what I have done with ReWrite to maintain _some_ consistency of notation,
>is that I have defined operation such as plus, not, etc. and effectively
>defined the infix forms as being equivalent to the prefix ones, so


>a+b is _exactly_ equivalent to plus[a,b]
>!a is _exactly_ equivalent to not[a],


>so I can deal with these functions in the same way as any others.


>(The reason that I have used words rather than symbols for prefix operators
>is that I have chosen that 'names' must be (alpha)(alpha|digit)+ and it is
>good to be able to 'get at' these functions)


>Admittedly, I haven't implemented full objects yet (still trying to decide
>what I want) so I don't know how tough this will be.


Sather, a fully object-oriented language (freely available from
icsi.berkeley.edu), uses this same notion and calls it "syntax
sugar". It's adopted rather extensively in the language; for
example, a[b]=c in Sather is defined to be syntax sugar for the
expression a.aset(b,c) (call of method aset on object a with
parameters b and c), a=b is sugar for a(b) (call of method a
on object self with parameter b), etc etc.


I'm curious -- is this notion of non-alphanumeric notation
as systematic syntactic sugar for well-defined alphanumeric
notation an independent inversion of you and Ousterhout
(the Father of Sather:-), derived from a common, older
source, or what...? Other languages using it...?




Alex
--
Email: martelli@cadlab.it Phone: +39 (51) 597313
CAD.LAB s.p.a., v. Ronzani 7/29, Casalecchio, Italia Fax: +39 (51) 597120
[Ned Irons' IMP72 did something like that over 20 years ago. It used an
Earley parser so you could use any awful ambiguous syntax you wanted,
and most people did. -John]


--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.