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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,ec06888ca495a8ff,start X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!v33g2000cwv.googlegroups.com!not-for-mail From: "benibilme@gmail.com" Newsgroups: comp.lang.ada Subject: Newbie question: Implementing a callback mechanism with Ada 83 Date: 10 Feb 2007 11:38:19 -0800 Organization: http://groups.google.com Message-ID: <1171136299.920852.179650@v33g2000cwv.googlegroups.com> NNTP-Posting-Host: 88.243.112.130 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1171136316 16578 127.0.0.1 (10 Feb 2007 19:38:36 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sat, 10 Feb 2007 19:38:36 +0000 (UTC) User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: v33g2000cwv.googlegroups.com; posting-host=88.243.112.130; posting-account=nCJDeg0AAABbwCDK7NEKPtAEyr16KPS9 Xref: g2news2.google.com comp.lang.ada:9237 Date: 2007-02-10T11:38:19-08:00 List-Id: Hello, I need to develop an Ada application which must conform to Ada83. It will be part of legacy system. I am very much new in Ada. The application I have to develop is very much event driven. As an old time C programmer I wanted to implement an event handling module which you can subscribe callback functions and trigger the events when necessary and unfortunately I have realized that Ada 83 does not support pointer to subprograms. I have read about generics with which defining subprograms as parameters of subprograms seems possible. On the other hand, I could not figure out how to do it. I simply want to store function pointers to some data structure for some certain events and call them with dynamic data when the event is triggered. How can I do it in Ada 83 without the support of pointers to subprograms. It is clear how to do this Ada95 as there is a direct support for pointer to subprograms. Any help is much appreciated.