comp.lang.ada
 help / color / mirror / Atom feed
From: Mart van de Wege <mvdwege@gmail.com>
Subject: Simple Components: adding an existing object to a graph
Date: Sun, 26 Jan 2020 11:23:05 +0100
Date: 2020-01-26T11:23:05+01:00	[thread overview]
Message-ID: <87wo9eikja.fsf@gaheris.vdwege.eu> (raw)

This one's for Dimitry, probably: I want to create a genealogy of
persons using his generic directed weighted graph package.

I've seen how I can do that like this (example code, assuming an
instantiated Graph):

type Person is record
     Name: Unbounded_String,
     Age: Natural
end record;

and then adding it to the graph with:

Ancestor : Node := new Person;

However, assume I already have plenty of code to create and manipulate
Person objects, how do I assign an *existing* object of type Person to a
graph? Trying to do it the obvious way by assigning an access to Person
to a Node object gets me an error message that Node is not a general
access type.

Regards,

Mart van de Wege
-- 
"We will need a longer wall when the revolution comes."
--- AJS, quoting an uncertain source.

             reply	other threads:[~2020-01-26 10:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-26 10:23 Mart van de Wege [this message]
2020-01-26 13:10 ` Simple Components: adding an existing object to a graph Dmitry A. Kazakov
2020-01-26 13:24   ` Mart van de Wege
2020-01-26 14:48 ` Jeffrey R. Carter
2020-01-26 15:39   ` Mart van de Wege
2020-01-26 15:49   ` Mart van de Wege
replies disabled

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