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.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,d8e7e976ead4a812 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-05-15 15:31:17 PST From: "Kai Schuelke" Newsgroups: comp.lang.ada References: <5f4adaeaa2a7b35810acd4e20fb98b25.86200@mygate.mailgate.org> <3ce15027.0@news.unibw-muenchen.de> Subject: Re: Function pointer in Ada? Date: Thu, 16 May 2002 00:30:37 +0200 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 NNTP-Posting-Host: bl15-1107.studfb.unibw-muenchen.de Message-ID: <3ce2e175.0@news.unibw-muenchen.de> X-Trace: 16 May 2002 00:30:13 +0100, bl15-1107.studfb.unibw-muenchen.de Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news-han1.dfn.de!news-nue1.dfn.de!uni-erlangen.de!lrz.de!news.unibw-muenchen.de!bl15-1107.studfb.unibw-muenchen.de Xref: archiver1.google.com comp.lang.ada:24132 Date: 2002-05-16T00:30:37+02:00 List-Id: Hi, I solved the problem like you suggested but I think that there must be a better way to do it, too. I want a program that can solve every mathematical function (e.g.: z = 2*x + sin(x)) for any value (e.g. x=4). It is enough to work with one mathematical function at a time. My spec looks like: -- Spec package math is procedure Set_Function(Func : in STRING); function Calculate(Value : in FLOAT) return FLOAT; end math; -- Sample program with math; use math; procedure sample is result : FLOAT; begin Set_Function("2*x+sin(x)"); result := Calculate(4.0); end; What would be the Ada way to do this?