From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Path: eternal-september.org!reader02.eternal-september.org!aioe.org!5WHqCw2XxjHb2npjM9GYbw.user.gioia.aioe.org.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Ada syntax questions Date: Wed, 23 Dec 2020 09:59:46 +0100 Organization: Aioe.org NNTP Server Message-ID: References: <5fdbde31$0$6455$426a74cc@news.free.fr> <87r1nkb0lj.fsf@nosuchdomain.example.com> NNTP-Posting-Host: 5WHqCw2XxjHb2npjM9GYbw.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 X-Notice: Filtered by postfilter v. 0.9.2 Content-Language: en-US Xref: reader02.eternal-september.org comp.lang.ada:60935 List-Id: On 2020-12-23 02:23, Randy Brukardt wrote: > "Dmitry A. Kazakov" wrote in message > news:rrs92d$1pfi$1@gioia.aioe.org... > ... >> But you cannot rid of X(...) syntax, where X is an object. > > That's a prefixed view, of course. No one would want to get rid of that. Hmm, where is the operation? A prefixed view is .(...) Indexing is (...) In particular: "abc"(1) >> It is not only indexing, e.g. in declarations: >> X : T (Y); > > That's not an expression and is not resolved (that is, there is no possible > overloading). I see no fundamental difference between "first-class" expressions and type-expressions. > ... >> Then what is wrong with indexing? > > Nothing is "wrong" with it, it is just redundant. As others have noted here, > both indexes and function calls represent a mapping. What's the point of > having two ways to represent a mapping? In an Ada-like language, there's no > syntax nor semantic difference. Both are mappings, but unless you make functions first-class citizens there exist language level difference between a function and a container object. > Ada (and most other languages) are full of redundant stuff. Simpilfy the > basics and then one has more room for interesting stuff (static analysis, > parallel execution, etc.). Yes, but I would rather keep all this stuff in the language making it overridable primitive operations. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de