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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,effb80d4bb7716dd X-Google-Attributes: gid103376,public From: Tucker Taft Subject: Re: Wanted: Ada STL. Reward: Ada's Future Date: 1999/02/05 Message-ID: <36BB3910.B460D8B@averstar.com>#1/1 X-Deja-AN: 441078936 Content-Transfer-Encoding: 7bit Sender: news@inmet.camb.inmet.com (USENET news) X-Nntp-Posting-Host: houdini.burl.averstar.com References: <790f4q$3l@bgtnsc01.worldnet.att.net> <36B856E4.D921C1D@bton.ac.uk> <36BAEA8B.5B375A30@bton.ac.uk> Content-Type: text/plain; charset=us-ascii Organization: AverStar (formerly Intermetrics) Burlington, MA USA Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 1999-02-05T00:00:00+00:00 List-Id: John English wrote: > ... > But anyway: a strength of the STL which seems difficult (impossible?) > to reproduce in Ada is the ability to treat built-in collection types > (arrays) in *exactly* the same way as user-defined collection types > (vectors, maps, etc.). You could certainly create an iterator for arrays that matched whatever general iterator scheme you decide is best (presumably by instantiating a generic package). In my view, the C++ STL is (appropriately) following along in the general C/C++ philosophy emphasizing writability over readability. An Ada 95 STL should follow Ada's emphasis of readability over writability. Combining the notion of an iterator and a handle into a single thing which resembles a C/C++ pointer seems very inappropriate for Ada. If you have two separate types, one for the iterator, and one for the handle, there is less confusion for the reader, but probably more work for the writer. Perhaps the C++ tendency of trying to have a single class do everything is part of the source of the difference. In Ada, you could have a single package with multiple types (handle, various iterators, etc), which in the case of a collection, seems very sensible. Because C++ and other class-oriented OOPs typically merge the notion of types and modules, they tend to get a bit miserly with types/classes, and try to make a single type play several roles, which can be confusing to the reader. > ----------------------------------------------------------------- > John English | mailto:je@brighton.ac.uk > Senior Lecturer | http://www.it.bton.ac.uk/staff/je > Dept. of Computing | ** NON-PROFIT CD FOR CS STUDENTS ** > University of Brighton | -- see http://burks.bton.ac.uk > ----------------------------------------------------------------- -Tuck -- -Tucker Taft stt@averstar.com http://www.averstar.com/~stt/ Technical Director, Distributed IT Solutions (www.averstar.com/tools) AverStar (formerly Intermetrics, Inc.) Burlington, MA USA