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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 109fba,582dff0b3f065a52 X-Google-Attributes: gid109fba,public X-Google-Thread: 1014db,582dff0b3f065a52 X-Google-Attributes: gid1014db,public X-Google-Thread: 103376,bc1361a952ec75ca X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-08-08 22:36:32 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!paloalto-snf1.gtei.net!news.gtei.net!enews.sgi.com!newshub2.rdc1.sfba.home.com!news.home.com!news1.rdc2.on.home.com.POSTED!not-for-mail Message-ID: <3B722166.AFBFE73A@home.com> From: "Warren W. Gay VE3WWG" X-Mailer: Mozilla 4.75 [en] (Windows NT 5.0; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada,comp.lang.c,comp.lang.c++ Subject: Re: How Ada could have prevented the Red Code distributed denial of service attack. References: <3b690498.1111845720@news.worldonline.nl> <9kbu15$9bj@augusta.math.psu.edu> <9kbvsr$a02@augusta.math.psu.edu> <3B69DB35.4412459E@home.com> <9kp9n7$ivm$1@nh.pace.co.uk> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Thu, 09 Aug 2001 05:36:31 GMT NNTP-Posting-Host: 24.141.193.224 X-Complaints-To: abuse@home.net X-Trace: news1.rdc2.on.home.com 997335391 24.141.193.224 (Wed, 08 Aug 2001 22:36:31 PDT) NNTP-Posting-Date: Wed, 08 Aug 2001 22:36:31 PDT Organization: Excite@Home - The Leader in Broadband http://home.com/faster Xref: archiver1.google.com comp.lang.ada:11663 comp.lang.c:73085 comp.lang.c++:81151 Date: 2001-08-09T05:36:31+00:00 List-Id: Bart.Vanhauwaert@nowhere.be wrote: > Marin David Condic wrote: > > And don't forget 'Range - very useful for "for" loops. And the same thing > > works with multiple dimensions as in Some_Array'First (1) or > > Some_Array'Range (2) or Some_Array'Length (N). What is really useful here is > > that if you avoid coding things with hard references into the array, you can > > pretty much leave the code untouched if/when you make any changes to the > > sizes/indexes of the array. It gets even more useful when trying to write > > generic array utilities or utilities that can deal with a *slice* of an > > array. (Like: "Some_Procedure (Some_Array (6..23)) ;" - if the internals use > > the attributes, it works nicely for any slice.) > > I am not really sure where this is fundamentally different from > > for (std::vector::iterator i=v.begin(); i!=v.end(); ++i) > ... > > and Yes, but your STL classes cannot help you to deal with regular arrays. In Ada, these attributes work on _any_ array. Not just ones cooked up by your STL classes. > Some_Procedure(v.begin()+6, v.begin()+23); > > and > > v.size() > > (Btw, as an application programmar, I get supicious whenever I see > a fixed size array. It means some arbitrary limit (or arbitrary > waste of resources) that some user eventually will stumble upon and > of course complain) > > cu bart Fixed sized arrays occur all the time. When you fill out tax forms, medical forms, drivers license forms, are not all the spaces fixed in length? Fixed lengths occur all the time in programmed systems as well. Even when "length" is not fixed, often the maximum is. I know the point you're making, but its not justified here. For example, pipe(2) is not going to have a problem with an array of 2 file descriptors in an int[2] array. It's never going to return more than 2. No need to make a conspiracy out of it ;-) -- Warren W. Gay VE3WWG http://members.home.net/ve3wwg