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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,fa22a73e140a6fd1 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.117.197 with SMTP id kg5mr10312286pbb.5.1326184494904; Tue, 10 Jan 2012 00:34:54 -0800 (PST) Path: lh20ni162951pbb.0!nntp.google.com!news1.google.com!goblin2!goblin.stu.neva.ru!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Object-Oriented style question Date: Tue, 10 Jan 2012 09:34:22 +0100 Organization: cbb software GmbH Message-ID: <1vvet6wyyzd7c$.36y88vkv8wfh$.dlg@40tude.net> References: <4f098fcb$0$6577$9b4e6d93@newsspool3.arcor-online.net> <2c213807-20cd-4b06-b2fa-c27827c9b747@f11g2000yql.googlegroups.com> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: FbOMkhMtVLVmu7IwBnt1tw.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Date: 2012-01-10T09:34:22+01:00 List-Id: On Mon, 9 Jan 2012 14:34:17 -0800 (PST), Adam Beneschan wrote: > I think there are very good reasons for using anonymous access- > subprogram parameters. No. In most cases access-to-subprogram parameter should have been a subprogram parameter, if Ada only supported that. If you meant rather that anonymous access to subprogram is better than named one, that is also debatable. Anonymous access-to-subprogram is weakly typed in the sense that it wrongly presumes that all subprograms of same parameter profile are exchangeable = belong to compatible subtypes. That is certainly not a strong typed approach. It is a hack necessary *because* subprograms in Ada have no explicit types. If they had: type procedure Differentiable (X : Float) return Float; type procedure Non_Differentiable (X : Float) return Float; Sine_Waveform : Differentiable; -- Sine is differentiable Square_Waveform : Non_Differentiable; -- Squares are non-differentiable procedure Differentiate (F : Differentiable); -- You cannot pass squares here -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de