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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,672b169dc220673a X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.204.143.145 with SMTP id v17mr1223861bku.7.1337419791494; Sat, 19 May 2012 02:29:51 -0700 (PDT) Path: e27ni15613bkw.0!nntp.google.com!news1.google.com!goblin3!goblin2!goblin.stu.neva.ru!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Vector (container) initialization: the schizophrenic ampersand Date: Sat, 19 May 2012 11:28:31 +0200 Organization: cbb software GmbH Message-ID: <1mffjt3nlbzpb.1ew7gjb3p6mmh$.dlg@40tude.net> References: <10616734.43.1337286031745.JavaMail.geo-discussion-forums@vbjy7> <70510fa1-e554-44a7-9364-e745674c1bda@googlegroups.com> <28845c63-b06c-4ac2-b5d5-e408c0ff4b7f@googlegroups.com> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: 4RFYTQ6jM/dAKFJoI0fUkg.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Date: 2012-05-19T11:28:31+02:00 List-Id: On Thu, 17 May 2012 23:51:52 -0700 (PDT), Marius Amado-Alves wrote: > Adam is right: it is confusion with the predefined "&" for arrays, when > the elements are arrays. (But the compiler error messages indicate > undecision only between the two Vectors "&" functions.) So my new solution > is > > function "+" (L : My_Vectors.Vector; R : My_Element_Type) > renames My_Vectors."&"; > > function "+" (L, R : My_Element_Type) > renames My_Vectors."&"; > > V : My_Vectors.Vector := Element1 + Element2 + Element3; What if My_Element_Type is numeric? It is always problematic to mix sets and elements of. The idea to overload an operation for both is attractive but guaranteed to have issues. Semantically correct is: (Element1, Element2, Element3) Yet another trick to disambiguate: Empty & Element1 & Element2 & Element3 -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de