From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: * X-Spam-Status: No, score=1.3 required=5.0 tests=BAYES_00,INVALID_MSGID, MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,88e7ef9008757431 X-Google-Attributes: gid103376,public From: Martin Gangkofer Subject: Re: Function Calls by Address Date: 1999/08/31 Message-ID: <7qfu47$2m2$1@nnrp1.deja.com>#1/1 X-Deja-AN: 519182041 References: <37CADE68.6AF06F5D@escmail.orl.lmco.com> <7qf2mi$g4h$1@nnrp1.deja.com> X-Http-Proxy: 1.0 www-proxy.dortmund.de.uu.net:3128 (Squid/2.2.STABLE3), 1.0 x21.deja.com:80 (Squid/1.1.22) for client 195.124.164.3, 192.76.144.30 Organization: Deja.com - Share what you know. Learn what you don't. X-Article-Creation-Date: Tue Aug 31 06:52:57 1999 GMT X-MyDeja-Info: XMYDJUIDmttg Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.06 [en] (WinNT; I ;Nav) Date: 1999-08-31T00:00:00+00:00 List-Id: In article <7qf2mi$g4h$1@nnrp1.deja.com>, Robert Dewar wrote: > In article <37CADE68.6AF06F5D@escmail.orl.lmco.com>, > Craig Jameson 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.