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,88093378be1184d4 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-11-10 20:06:48 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!fu-berlin.de!uni-berlin.de!ppp-1-57.cvx6.telinco.NET!not-for-mail From: "Nick Roberts" Newsgroups: comp.lang.ada Subject: Re: List Container Straw Man Date: Sun, 11 Nov 2001 03:48:00 -0000 Message-ID: <9sktgl$134npc$2@ID-25716.news.dfncis.de> References: <9s941p$11mrei$4@ID-25716.news.dfncis.de> <9s99tt$pdb$1@nh.pace.co.uk> <9s9s8p$11vt7l$1@ID-25716.news.dfncis.de> <9sc5l8$9b7$1@nh.pace.co.uk> <9scke8$12jb14$3@ID-25716.news.dfncis.de> <9sdnva$dpk$1@news.huji.ac.il> <9seup4$12h0ar$3@ID-25716.news.dfncis.de> <9sib28$13aeg3$6@ID-25716.news.dfncis.de> <9sk0mc$39j$1@news.huji.ac.il> NNTP-Posting-Host: ppp-1-57.cvx6.telinco.net (212.1.156.57) X-Trace: fu-berlin.de 1005451606 36855596 212.1.156.57 (16 [25716]) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Xref: archiver1.google.com comp.lang.ada:16267 Date: 2001-11-11T03:48:00+00:00 List-Id: "Ehud Lamm" wrote in message news:9sk0mc$39j$1@news.huji.ac.il... > ... > My problem is on a more semantic level. To understand your approach students > must understand about inheritance (or so it seems to me). It is not like > instanating Integer_IO, which results in having "normal" procedures. > ... Not really. Having cited the magic incantation: package Widget_Iteration is new SCL.Iteration(Widget_Type); package Widget_Lists is new SCL.Lists.Unbounded(Widget_Iteration); subtype Widget_List is Widget_Lists.Unbounded_List; your students can (at first) use the type Widget_List straightforwardly without having to touch upon anything to do with inheritance, e.g.: L: Widget_List; W: Widget_Type; ... while not End_of_File(F) loop Read_Widget(F,W); Append(L,W); -- add to end of list L end loop; and so on. Later on in the course (much later), when they have done tagged types, inheritance, abstract types, generic packages, signature packages, etc., you can then introduce them to the idea of defining a procedure that can work with different container types, e.g.: function Count ( Widget: in Widget_Type; Within: in out Widget_Iteration.Sequence_Producer'Class) return Natural; and so on. -- Best wishes, Nick Roberts