comp.lang.ada
 help / color / mirror / Atom feed
From: Martin Gangkofer <mttg@my-deja.com>
Subject: Re: Function Calls by Address
Date: 1999/08/31
Date: 1999-08-31T00:00:00+00:00	[thread overview]
Message-ID: <7qfu47$2m2$1@nnrp1.deja.com> (raw)
In-Reply-To: 7qf2mi$g4h$1@nnrp1.deja.com

In article <7qf2mi$g4h$1@nnrp1.deja.com>,
  Robert Dewar <dewar@gnat.com> wrote:
> In article <37CADE68.6AF06F5D@escmail.orl.lmco.com>,
>   Craig Jameson <craigj@escmail.orl.lmco.com> wrote:
> > Does any one know how to make dynamic function calls in Ada83.
> > I am writing an application using AIX Motif bindings and I
> > need to create a dynamic list of functions to be called when
> > a particular X event is dispatched.  Any ideas on how to
> > create and use such a list?
>
> There is no way to do this in Ada 83. A given Ada 83 compiler
> may have some implementation dependent kludge, e.g. the
> pragma Import with address clause trick. Contact your vendor
> here, this is not a language question! At the very least you
> have to say exactly what compiler you are using on what machine,
> and of course it should be noted that in Ada 95, the solution
> is straightforward.
>
> Robert Dewar
> Ada Core Technologies
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.
>

I think it is wrong to state, that it is impossible even if you plan to
implement callbacks by dynamic procedure call.

The term 'dynamic' is - due to the finite nature of computers we are
working with - only another word for 'unknown static set'. The original
posting already indicates, that some procedure from within a list shall
be called. I suppose, that this list is a known list.

Well, the usual way to handle this kind of problems in Ada.83 is to
replace machine addressing by generation of an abstract addressing
space, i.e. some discrete type together with a an operation selecting
the correct call from a value of this type.
If the task of writing such code apears to huge for you use a database
and some source code generating scripts (e.g. perl).

MtG
--
Martin Gangkofer, System Engineer
ESG Elektroniksystem und -Logistik GmbH, Dept.EF-E
eMail: mgangkof@esg-gmbh.de
Tel:   +49 89 9216 2176


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.




  reply	other threads:[~1999-08-31  0:00 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-08-30  0:00 Function Calls by Address Craig Jameson
1999-08-30  0:00 ` Marin David Condic
1999-08-30  0:00   ` Marin David Condic
1999-08-30  0:00     ` Larry Kilgallen
1999-08-30  0:00   ` Robert Dewar
1999-08-30  0:00 ` Robert Dewar
1999-08-31  0:00   ` Martin Gangkofer [this message]
1999-08-30  0:00 ` Robert Dewar
1999-08-31  0:00 ` Matthew Heaney
1999-08-31  0:00 ` David Kristola
1999-09-01  0:00 ` Simon Wright
1999-09-02  0:00 ` Francois Godme
1999-09-03  0:00   ` Robert Dewar
1999-09-03  0:00     ` Francois Godme
1999-09-03  0:00       ` Simon Wright
1999-09-03  0:00       ` Robert Dewar
1999-09-03  0:00         ` Ted Dennison
1999-09-04  0:00           ` Jean-Pierre Rosen
1999-09-05  0:00             ` Matthew Heaney
1999-09-05  0:00             ` Ehud Lamm
1999-09-04  0:00         ` Brian Rogoff
1999-09-05  0:00           ` Robert Dewar
1999-09-05  0:00           ` Robert Dewar
1999-09-05  0:00           ` Robert Dewar
1999-09-03  0:00       ` Marin David Condic
1999-09-14  0:00         ` Robert I. Eachus
     [not found]           ` <wcc3dwgb7ii.fsf@world.std.com>
     [not found]             ` <37E81079.CC2566D9@mitre.org>
1999-09-22  0:00               ` Robert A Duff
1999-09-22  0:00                 ` Robert I. Eachus
1999-09-23  0:00                 ` Robert Dewar
1999-09-23  0:00                   ` Robert A Duff
1999-09-03  0:00       ` David C. Hoos, Sr.
1999-09-04  0:00         ` Robert Dewar
1999-09-05  0:00           ` Francois Godme
1999-09-06  0:00             ` Robert Dewar
1999-09-06  0:00               ` Francois Godme
1999-09-06  0:00                 ` Robert Dewar
1999-09-06  0:00                   ` Bob Collins
1999-09-07  0:00                     ` Pascal Obry
1999-09-06  0:00                 ` Robert Dewar
1999-09-07  0:00                 ` Pascal Obry
1999-09-07  0:00                   ` Francois Godme
1999-09-08  0:00                   ` Francois Godme
1999-09-04  0:00       ` Mario Klebsch
1999-09-05  0:00         ` Robert Dewar
1999-09-06  0:00           ` Francois Godme
1999-09-05  0:00             ` Brian Rogoff
1999-09-06  0:00             ` Robert Dewar
1999-09-08  0:00               ` Georg Bauhaus
1999-09-05  0:00       ` Geoff Bull
1999-09-07  0:00       ` Michael F. Yoder
replies disabled

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