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,782af4edeb84c4b7 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!news2.google.com!news.maxwell.syr.edu!kanaga.switch.ch!ezmp3.switch.ch!news-zh.switch.ch!switch.ch!cernne03.cern.ch!not-for-mail From: Maciej Sobczak Newsgroups: comp.lang.ada Subject: Re: basic basic ada question Date: Fri, 20 Oct 2006 13:15:23 +0200 Organization: CERN News Message-ID: References: <1161268231.345231.242170@m73g2000cwd.googlegroups.com> <4537bc65_1@newsfeed.slurp.net> <5567b72ia0c9$.1b6yl0tpfscj5$.dlg@40tude.net> NNTP-Posting-Host: abpc10883.cern.ch Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: cernne03.cern.ch 1161342923 22369 137.138.37.241 (20 Oct 2006 11:15:23 GMT) X-Complaints-To: news@@cern.ch NNTP-Posting-Date: Fri, 20 Oct 2006 11:15:23 +0000 (UTC) User-Agent: Thunderbird 1.5.0.7 (X11/20060922) In-Reply-To: <5567b72ia0c9$.1b6yl0tpfscj5$.dlg@40tude.net> Xref: g2news2.google.com comp.lang.ada:7067 Date: 2006-10-20T13:15:23+02:00 List-Id: Dmitry A. Kazakov wrote: >>> There is no syntax >>> difference between arrays and functions of single argument. Looking at >>> Argument (I) you cannot tell if Argument is an array or not. >> Nor you can tell if it's a type conversion. > >> Ada consistently promotes explicit syntax for readability reasons, you >> know. ;-) > > Exactly! Because wether Argument (I) is a function call, array indexing, > conversion, that is an implementation detail for the reader. Interesting, but I prefer to see it completely the other way round. The function call, array indexing and conversion are concepts that convey some meaning to the reader (for example, with array indexing one can assume the lookup semantics, whereas for function call it's value computation) and thus should look different. On the implementation detail level, however, whether it's direct indexing or maybe overloaded function is not important. Thus (C++): a = b(c); // value computation a = b[c]; // lookup a = static_cast(c); // translation to domain b I don't care how they are implemented, but I care about their meaning. I agree that this is very subjective. > Note that, probably unlike others, I wouldn't object to add [x], {x}, , > |x|, (*x*), <+x+> and so on, brackets to Ada. But I do object to binding > language semantics to the tuple brackets. Any semantic difference between > A[x,y] and A(x,y) should come solely from the application domain. Yes. So we agree. :-) > That is > not language business. Well, language has to allow you to implement these operations. > Also, let's allow [], but then they should be > allowed to subprograms, as well as type conversions, entry points etc. It can be whatever - but the presence of square brackets in the source code means for me "lookup". Like phonebook lookup. -- Maciej Sobczak : http://www.msobczak.com/ Programming : http://www.msobczak.com/prog/