comp.lang.ada
 help / color / mirror / Atom feed
From: Egil H H <ehh.public@gmail.com>
Subject: Re: recursive map specification
Date: Tue, 25 Jun 2019 02:22:24 -0700 (PDT)
Date: 2019-06-25T02:22:24-07:00	[thread overview]
Message-ID: <2d66afde-4233-473b-96f3-4557e6ee0e69@googlegroups.com> (raw)
In-Reply-To: <06d8a01b-38ed-4c66-97e0-c2ee5073a0a3@googlegroups.com>

On Tuesday, June 25, 2019 at 11:09:20 AM UTC+2, mario.b...@gmail.com wrote:
> 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


Sorry, I haven't used that package myself, but there's some additional explanation and example in the Rationale, http://www.ada-auth.org/standards/12rat/html/Rat12-8-4.html


-- 
~egilhh

  reply	other threads:[~2019-06-25  9:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-25  8:21 recursive map specification mario.blunk.gplus
2019-06-25  8:44 ` Egil H H
2019-06-25  9:09   ` mario.blunk.gplus
2019-06-25  9:22     ` Egil H H [this message]
2019-06-25  9:24       ` mario.blunk.gplus
2019-06-26  5:23 ` Randy Brukardt
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox