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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Received: by 2002:ac8:d8:: with SMTP id d24mr104843273qtg.284.1561453759375; Tue, 25 Jun 2019 02:09:19 -0700 (PDT) X-Received: by 2002:aca:d656:: with SMTP id n83mr9860392oig.84.1561453759007; Tue, 25 Jun 2019 02:09:19 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!weretis.net!feeder6.news.weretis.net!feeder.usenetexpress.com!feeder-in1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!m24no3019730qtm.0!news-out.google.com!e20ni52qta.0!nntp.google.com!m24no3019727qtm.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Tue, 25 Jun 2019 02:09:18 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=87.154.194.176; posting-account=3zVVBwoAAAC7BSMfgNP7DSbqU9urpt40 NNTP-Posting-Host: 87.154.194.176 References: <187147dc-94fe-4019-bc42-5b214db452db@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <06d8a01b-38ed-4c66-97e0-c2ee5073a0a3@googlegroups.com> Subject: Re: recursive map specification From: mario.blunk.gplus@gmail.com Injection-Date: Tue, 25 Jun 2019 09:09:19 +0000 Content-Type: text/plain; charset="UTF-8" Xref: reader01.eternal-september.org comp.lang.ada:56751 Date: 2019-06-25T02:09:18-07:00 List-Id: On Tuesday, June 25, 2019 at 10:44:11 AM UTC+2, Egil H H wrote: > On Tuesday, June 25, 2019 at 10:21:03 AM UTC+2, mario.b...@gmail.com wrote: > > Hello, > > > > I want to specify a recursive map. To simplify the problem I use the example of a person and its ancestors and ancestors ... The problem does not seem special but I haven't found a solution. The approach below does not compile: > > > > type person is record > > name : unbounded_string; > > end record; > > > > package tree is new ordered_maps > > ( > > key_type => person, > > element_type => tree.map -- compiler error. "tree" undefined > > ); > > > > Any ideas ? Thanks a lot ! > > > Is there a reason you don't use Ada.Containers.Multiway_Trees instead? > > > -- > ~egilhh It is the first time I read about multiway_trees. Do you have a simple example ready ? Otherwise I would dig into the package docs which lack practical examples... Thanks