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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,d74d61525ce986e9 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-10-22 04:07:44 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.vmunix.org!news-FFM2.ecrc.net!news.iks-jena.de!not-for-mail From: Lutz Donnerhacke Newsgroups: comp.lang.ada Subject: Re: Implementing Memorize Date: Wed, 22 Oct 2003 11:07:43 +0000 (UTC) Organization: IKS GmbH Jena Message-ID: References: NNTP-Posting-Host: taranis.iks-jena.de X-Trace: branwen.iks-jena.de 1066820863 4900 217.17.192.37 (22 Oct 2003 11:07:43 GMT) X-Complaints-To: usenet@iks-jena.de NNTP-Posting-Date: Wed, 22 Oct 2003 11:07:43 +0000 (UTC) User-Agent: slrn/0.9.7.4 (Linux) Xref: archiver1.google.com comp.lang.ada:1398 Date: 2003-10-22T11:07:43+00:00 List-Id: * Marius Amado Alves wrote: >> What's the correct way to implement it? > > Maybe with an access-to-subprogram type. Of course this works. But I'm looking for a generic version. > What problem are your trying to solve? Calculating Fibbonacci numbers recursivly is easy but braindead. Languages with access to the symbol table at execution time are able to change the the reccuring call with a memorize wrapper which returns already computed values immediatly instead of recalculating them. In the referenced article I wrote an C-Implementation of such a wrapper. Now I'm looking for a more elegant version in Ada.