comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Simple Components (Generic_Directed_Graph)
Date: Mon, 30 Oct 2017 12:23:12 +0100
Date: 2017-10-30T12:23:12+01:00	[thread overview]
Message-ID: <ot722v$1sj0$1@gioia.aioe.org> (raw)
In-Reply-To: ot6vlg$1o05$1@gioia.aioe.org

On 2017-10-30 11:41, Victor Porton wrote:

> I do not understand your logic in Generic_Directed_Graph:
> 
> The procedures like
> 
> procedure Disconnect (Parent : Node; Child : Node);
> 
> do not take "Graph" argument.

A graph consists of connected nodes. Each node is in and a graph.

> Does it mean that there exists just one graph (per instantiation)?

No. If two nodes are mutually unreachable you have two graphs.

> This looks wrong for me. First it is using global variables.

It uses referential semantics. Node is an access type to the type you 
pass to the package when you instantiate it. E.g. if you want a graph of 
Strings you instantiate the package with String. Then Node is a pointer 
to string.

The notion of scope does not really applied to the structures like 
graph. You can scope the pool you pass to the instance. You can scope 
nodes with some logic attached when a node leaves its scope. But 
otherwise it makes little sense to talk about the scope of a graph.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de


  parent reply	other threads:[~2017-10-30 11:23 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-30 10:41 Simple Components (Generic_Directed_Graph) Victor Porton
2017-10-30 11:04 ` Victor Porton
2017-10-30 11:34   ` Dmitry A. Kazakov
2017-10-30 11:23 ` Dmitry A. Kazakov [this message]
2017-10-30 14:58   ` Victor Porton
2017-10-30 15:46     ` Dmitry A. Kazakov
2017-10-30 17:46       ` Dennis Lee Bieber
2017-10-30 20:29         ` Dmitry A. Kazakov
2017-10-30 15:13   ` Victor Porton
2017-10-30 15:54     ` Dmitry A. Kazakov
2017-10-30 18:30   ` Victor Porton
2017-10-30 20:43     ` Dmitry A. Kazakov
2017-10-30 21:20       ` Victor Porton
2017-10-30 22:39         ` Dmitry A. Kazakov
2017-10-31  7:36           ` Simon Wright
2017-10-31  8:16             ` Dmitry A. Kazakov
2017-10-31 11:12           ` Victor Porton
2017-10-31 12:42             ` Dmitry A. Kazakov
2017-10-31 15:07               ` Victor Porton
2017-10-31 15:48                 ` Dmitry A. Kazakov
replies disabled

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