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-Thread: 103376,bd50112c03f1f521 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!postnews.google.com!26g2000hsk.googlegroups.com!not-for-mail From: Ivan Levashew Newsgroups: comp.lang.ada Subject: Re: Defining a binary operator between function access types: Is it possible? Date: Mon, 20 Oct 2008 23:46:59 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: NNTP-Posting-Host: 92.125.97.147 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1224571619 12611 127.0.0.1 (21 Oct 2008 06:46:59 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 21 Oct 2008 06:46:59 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: 26g2000hsk.googlegroups.com; posting-host=92.125.97.147; posting-account=SWSr0goAAABcqpu6T_j1x1_Ub5y2Ekfy User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:2444 Date: 2008-10-20T23:46:59-07:00 List-Id: Nobody seems to mention another way to do the trick. One can use just downwards closures, and circumvent upwards closures restriction via CPS, e. g. add extra "Continuation : access procedure" argument in every procedure, and add extra "Continuation : access procedure (Result : Your_Result_Type)" argument in every function. It will actually work. Despite being clearly crazy (it blows your stack), blowing stack and heap is what actually happens when C++ compiler interpretes BOOST, Loki, Blitz++ sources. IIUC standards-compliant C++ compiler can't get rid of any of intermediate results. P. S. http://okasaki.blogspot.com/2008/07/functional-programming-inada.html