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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,604e0f87aa06eab6 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-03-24 10:08:27 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!fu-berlin.de!uni-berlin.de!dialin-145-254-037-231.arcor-ip.NET!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Imitation is the sincerest form of flattery Date: Mon, 24 Mar 2003 19:10:18 +0100 Organization: At home Message-ID: References: <1047665830.579605@master.nyc.kbcfp.com> <7eee7v4hpvj0i5s345uonlen5315rhiau8@4ax.com> <4dkea.75440$gi1.38045@nwrdny02.gnilink.net> <1048524746.273345@master.nyc.kbcfp.com> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: dialin-145-254-037-231.arcor-ip.net (145.254.37.231) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: fu-berlin.de 1048529305 77343696 145.254.37.231 (16 [77047]) User-Agent: KNode/0.7.1 Xref: archiver1.google.com comp.lang.ada:35656 Date: 2003-03-24T19:10:18+01:00 List-Id: Hyman Rosen wrote: > Dmitry A. Kazakov wrote: >> However, I am pretty aware that all unsolved problems with >> assignment/construction in Ada will inevitable show themselves for >> Set_Element. > > Have you tried C++? Surely. I have developed a whole class library with strings, dynamic arrays etc. > In C++ you can provide an indexing operation > for a class (operator[]) that sounds just like what you want. Nope. First of all, there is no contract. I want the compiler be aware that it is going to be an array and check if it is. Secondly to make A[i]=X working you have to use a reference. Now, let I a have a packed bit array. What would be a reference to a bit? You would need to build a fat pointer class to fix this. The array has to represent an image in the video buffer. It has to be damn FAST. And where are multidimensional arrays in C++? And where are slices? Well, for them we need another class, etc. And what if A is a hash table, sparse array. It would be monstrous. And I want it on the stack! IMO. The idea of treating A[i]=X; as Assign (Index (A, i), X); is a wrong one. -- Regards, Dmitry A. Kazakov www.dmitry-kazakov.de