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,8eff44ec1bcf8433 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-10-18 15:52:42 PST Newsgroups: comp.lang.ada Path: archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!newsfeed1.earthlink.net!newsfeed.earthlink.net!uunet!lax.uu.net!sac.uu.net!ash.uu.net!xyzzy!nntp From: Jeffrey Carter Subject: Re: Container reqs X-Nntp-Posting-Host: e246420.msc.az.boeing.com Content-Type: text/plain; charset=us-ascii Message-ID: <3BCF57C8.DE99D9C@boeing.com> Sender: nntp@news.boeing.com (Boeing NNTP News Access) Content-Transfer-Encoding: 7bit Organization: The Boeing Company X-Accept-Language: en References: <9qctpn$lil$1@news.huji.ac.il> <3nCy7.29644$ev2.35903@www.newsranger.com> <9qfgla$7sb$3@news.huji.ac.il> <9qnflg$pm$1@news.huji.ac.il> Mime-Version: 1.0 Date: Thu, 18 Oct 2001 22:29:28 GMT X-Mailer: Mozilla 4.73 [en]C-CCK-MCD Boeing Kit (WinNT; U) Xref: archiver1.google.com comp.lang.ada:14924 Date: 2001-10-18T22:29:28+00:00 List-Id: Ehud Lamm wrote: > > I have no problem with a Queue package paraemtrized by an Element type > (specified as private). Even novice Ada programmer must know how to > instantiate such packages if he uses Text_IO. How the Element type is specified in the generic formal part should reflect how the generic uses the type. A generic formal part is a specification of what the generic must be given to perform its service. A generic formal private type specifies that the generic will use ":=" and "=" for the type. If the generic doesn't use both, then the generic is incorrectly specified. If the generic only uses assignment, then the only way to specify this in Ada is type Element is limited private; with procedure Assign (To : in out Element; From : in Element); This is a failing in Ada, IMO. It might have been better to have something like type T is private; -- No operations defined, like Ada's limited private type T is private with ":="; -- Only assignment defined; no analog in Ada and allow the definition (in package specifications) or import (in generic formal parts) of "=". > What I dodn't like is the need for several, possibly nested, instantiations > simply to get a simple queue or hash table. I wholeheartedly agree. Wright's posting here a few days ago of the sequence of instantiations needed to obtain a simple structure with the Booch components clearly indicates that they fail this requirement. -- Jeffrey Carter