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 autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,d04a73d3b2c2dd0d X-Google-Attributes: gid103376,public From: jsa@alexandria (Jon S Anthony) Subject: Re: Q: Pointers to procedures/functions Date: 1997/04/11 Message-ID: #1/1 X-Deja-AN: 232377202 Distribution: world References: <1997Apr11.143821.5866@news> 14: 38:21 MET Organization: PSI Public Usenet Link Newsgroups: comp.lang.ada Date: 1997-04-11T00:00:00+00:00 List-Id: In article <1997Apr11.143821.5866@news> Gautier.DeMontmollin@maths.unine.ch (Gautier) writes: > Is there a way to have pointers to procedures in Ada ? > > I wish to use e.g. functions float -> float as parameters for a graph > procedure. > > G. In Ada95, no problem. Here's a snip from the Rationale: "type Trig_Function is access function(F: Float) return Float; T: Trig_Function; X, Theta: Float; and T can then "point to" functions such as Sin, Cos and Tan. We can then assign an appropriate access-to-subprogram value to T by for example T := Sin'Access;" If you are stuck with Ada(83), the vendor for your compiler has probably supplied an implementation dependent way to do this. /Jon -- Jon Anthony Organon Motives, Inc. Belmont, MA 02178 617.484.3383 jsa@organon.com