From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Is this actually possible?
Date: Thu, 12 Dec 2019 15:32:16 +0100
Date: 2019-12-12T15:32:16+01:00 [thread overview]
Message-ID: <qstj1i$1f4l$1@gioia.aioe.org> (raw)
In-Reply-To: 23879d99-f1b0-4ade-8f2a-e45014fa04a7@googlegroups.com
On 2019-12-12 11:17, Lucretia wrote:
> On Wednesday, 11 December 2019 21:34:15 UTC, Dmitry A. Kazakov wrote:
>> On 2019-12-11 22:12, Lucretia wrote:
>>> On Wednesday, 11 December 2019 19:58:54 UTC, Dmitry A. Kazakov wrote:
>>
>>>> If you need objects that could be packed into C arrays use a variant
>>>> record with the choice discriminant having a default.
>>>
>>> But in my cases, a variant cannot be used.
>>
>> Why? You must know all variants in order to compute the array element
>> size. In Ada you cannot have it either:
>
> Because it's a binding to a C record: https://github.com/Lucretia/aplug/blob/master/ladspa/src/ladspa.ads#L113
I cannot recognize problem there.
P.S. You can take a look at GtkAda design. It deploys a typical model. C
API have a user data void * field allocated in all C objects. GtkAda
creates an Ada object, creates a C object. Sets the user field in the C
object to point to the Ada object and passes the C object to GTK. That
way the hierarchy of C objects has a parallel hierarchy of tagged Ada
objects.
--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de
next prev parent reply other threads:[~2019-12-12 14:32 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-11 16:43 Is this actually possible? Lucretia
2019-12-11 17:38 ` Dmitry A. Kazakov
2019-12-11 17:54 ` Lucretia
2019-12-11 19:55 ` Randy Brukardt
2019-12-11 19:58 ` Dmitry A. Kazakov
2019-12-11 21:12 ` Lucretia
2019-12-11 21:34 ` Dmitry A. Kazakov
2019-12-12 2:00 ` Randy Brukardt
2019-12-12 9:26 ` Niklas Holsti
2020-04-08 16:10 ` Alejandro R. Mosteo
2019-12-12 10:17 ` Lucretia
2019-12-12 14:32 ` Dmitry A. Kazakov [this message]
2019-12-12 15:14 ` Lucretia
2019-12-12 15:15 ` Lucretia
2019-12-12 18:24 ` Dmitry A. Kazakov
2019-12-12 18:30 ` Lucretia
2019-12-12 19:09 ` Dmitry A. Kazakov
2019-12-12 20:54 ` Lucretia
2019-12-12 21:12 ` Dmitry A. Kazakov
2019-12-13 11:11 ` Lucretia
2019-12-11 19:59 ` 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