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-Thread: a07f3367d7,de7dd126d6737f3a X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!news1.google.com!newsfeed2.dallas1.level3.net!news.level3.com!bloom-beacon.mit.edu!newsswitch.lcs.mit.edu!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Callback in Ada Date: Tue, 04 Jan 2011 14:47:42 -0500 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <8lc2d0Fb6jU1@mid.individual.net> <4cf0ec67$0$6882$9b4e6d93@newsspool2.arcor-online.net> <393221c0-ac56-436f-b3f8-280c40d5a53a@j1g2000vbl.googlegroups.com> <10p6vzd761rdz$.1gtmc0fk6t9rb.dlg@40tude.net> <704b1c18-9d58-420f-b7af-205ccd1ca7ad@g26g2000vbz.googlegroups.com> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: pcls6.std.com 1294170462 29715 192.74.137.71 (4 Jan 2011 19:47:42 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Tue, 4 Jan 2011 19:47:42 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:sWlaXFPcGKIE/Y9S6Kd13VqusNE= Xref: g2news2.google.com comp.lang.ada:17293 Date: 2011-01-04T14:47:42-05:00 List-Id: "Alex Mentis" writes: > Since it�s the topic of discussion, and since you wrote the proposal, > is it true that expression functions (which, in effect, appear to be > function specifications that include small expressions as the function > bodies), when supported, could appear in a package specification, Yes. One reason you might want to do that is when you call an expression function in a precondition, and you want the compiler or other tool to know what it does (at compile time of clients), to help it prove things. During the design, I argued that it's going to be annoying, because as soon as you want a local variable inside that function, you have to move it to the package body, weakening the ability to prove things. So we should simply allow subprogram bodies in package specs. Others argued that we don't want to give people the ability to completely dispense with Ada's separation of spec and body. Also, the expression function syntax is nice for short "one liners", where the extra verbiage of "begin" and "end Blah;" is just noise. - Bob