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: 103376,2eac5e4279bf777c X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-07-16 21:26:04 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!newsfeed.berkeley.edu!ucberkeley!sjc-peer.news.verio.net!news.verio.net!sea-read.news.verio.net.POSTED!not-for-mail Newsgroups: comp.lang.ada From: Brian Rogoff Subject: Re: C++ STL Components and Ada In-Reply-To: <3B5237EC.D54299A7@worldnet.att.net> Message-ID: References: <3B5237EC.D54299A7@worldnet.att.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Date: Tue, 17 Jul 2001 04:26:02 GMT NNTP-Posting-Host: 206.184.139.136 X-Complaints-To: abuse@verio.net X-Trace: sea-read.news.verio.net 995343962 206.184.139.136 (Tue, 17 Jul 2001 04:26:02 GMT) NNTP-Posting-Date: Tue, 17 Jul 2001 04:26:02 GMT Organization: Verio Xref: archiver1.google.com comp.lang.ada:10043 Date: 2001-07-17T04:26:02+00:00 List-Id: On Mon, 16 Jul 2001, James Rogers wrote: > Occasionally I read questions from Ada newbies about the presence of > Ada equivalents to the C++ STL. > > After many years of reading about and hearing from C++ programmers that > the STL is the best thing since the invention of fire, I decided to > look into exactly what the STL is. Ok, I took a little longer than > others :-). The important thing you seem to be missing in your post is the presence of an ancillary type called iterators which are defined over the containers and abstract the traversal so that algorithms are decoupled from containers. You can do this in Ada too, but it's notationally a bit nicer in C++ since the iterators over the commonest sequences map directly to pointers. I wouldn't say they're the best thing since the invention of fire, but C++ templates allow all sorts of interesting things, almost like macros, but linked with the type system. They provide a crude form of parametric polymorphism which doesn't have the overhead associated with typical implementations of polymorphic languages. I can easily imagine an Ada-like language which steals some nice aspects of C++ templates. -- Brian