From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,81bb2ce65a3240c3 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.238.65 with SMTP id vi1mr5259692pbc.7.1341057613909; Sat, 30 Jun 2012 05:00:13 -0700 (PDT) Path: l9ni2128pbj.0!nntp.google.com!news1.google.com!goblin1!goblin.stu.neva.ru!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: Brian Drummond Newsgroups: comp.lang.ada Subject: Re: What would you like in Ada202X? Date: Sat, 30 Jun 2012 12:00:13 +0000 (UTC) Organization: A noiseless patient Spider Message-ID: References: <3637793.35.1335340026327.JavaMail.geo-discussion-forums@ynfi5> Mime-Version: 1.0 Injection-Date: Sat, 30 Jun 2012 12:00:13 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="DkTdSjxOCm6DqG+Uf7eArg"; logging-data="29314"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19DZJsksLeyNwZnXrCUQzY54WffR2IXAkE=" User-Agent: Pan/0.135 (Tomorrow I'll Wake Up and Scald Myself with Tea; GIT 30dc37b master) Cancel-Lock: sha1:befa/8Ffjb7eMWDvlXEd9YUK2KI= Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Date: 2012-06-30T12:00:13+00:00 List-Id: On Wed, 25 Apr 2012 00:47:06 -0700, Martin wrote: > Ok, we don't officially have Ada2012 yet but as no new features are > going to be added to it, now seems like a good time to start thinking > about the next revision. > > My starters for 10 are: > > 1) 1st class functions / lambdas 2) parallel loops / functions 3) > Multiple dispatch > > -- Martin We can overload existing operators (+,-,etc) But we can't define new ones, e.g. // to denote the value of electronic components connected in a parallel circuit) or -- (bad choice! maybe ++) for series connection. For example, the definition of // would clearly be different for resistance and capacitance, which we can assume to be distinct types of complex number. The last language I used that allowed this, (Lingo, on the Linn Rekursiv) restricted the characters used to build such an operator to a suitable set, chosen to avoid clashes with the inherent language syntax, so no { or } for example. One obvious problem with an extensible set of operators, in an operator precedence grammar, is assigning the precedence level of new operators. Lingo resolved that dilemma by assigning the same precedence to all operators! You explicitly wrote a + (b*c) - d to achieve the usual precedence. Simple, clean, and effective, but entirely inappropriate for Ada! Given that ways can be found to assign precedence to new operators, why are extensible operators not found in more languages that allow overloading? It would seem to be a useful way to add expressibility, and I can't see any fundamental drawbacks. If the demand is not there, is that because it has been considered and rejected, or is it simply below everyone's radar? - Brian