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,dff686f95f235879,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-01-15 19:02:06 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!newsfeed.vmunix.org!news-peer.gradwell.net!not-for-mail Newsgroups: comp.lang.ada From: porton@ex-code.com (Victor Porton) Date: Thu, 16 Jan 2003 08:01:17 +0500 Organization: Extreme Code Software (http://ex-code.com) Subject: Composing sequences (interesting to solve) Mime-Version: 1.0 X-Newsreader: knews 1.0b.1 Content-Type: text/plain; charset=us-ascii X-URL: http://www.ex-code.com/ Message-ID: <3e2620ad$0$33930$bed64819@news.gradwell.net> NNTP-Posting-Date: 16 Jan 2003 03:02:05 GMT NNTP-Posting-Host: 195.149.39.13 X-Trace: 1042686125 news.gradwell.net 33930 mail2news/195.149.39.13 X-Complaints-To: news-abuse@gradwell.net Xref: archiver1.google.com comp.lang.ada:33071 Date: 2003-01-16T03:02:05+00:00 List-Id: See an interesting and yet unsolved by me practical task to solve: I have "elements" of various kinds (Base_Element'Class): type Base_Element is null record; There are many various types of element derived from Base_Element. Some of these contain accesses to other elements (which I allocate by "new"), so that this forms trees. To eliminate access types conversions I decided to limit myself to use only Base_Element_Access (not accesses to derived types) (BTW, Is it right design decision?): type Base_Element_Access is access Base_Element'Class; One of the types of elements is "sequence" (it is an ordered container of elements): type Sequence is new Base_Element with private; I wish to produce sequences (allocated dynamically) by such the syntax using overloaded function "&": E1 & E2 & E3 The question is how to define function "&" so that it would give the right result (access to one dynamically allocated sequence) independingly on the number of elements?