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: a07f3367d7,bde430ece5c51468,start X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,CP1252 Path: g2news2.google.com!postnews.google.com!k19g2000yqc.googlegroups.com!not-for-mail From: =?ISO-8859-1?Q?Hibou57_=28Yannick_Duch=EAne=29?= Newsgroups: comp.lang.ada Subject: Tagged type more type safe than access to subprogram ? Date: Wed, 28 Oct 2009 00:51:19 -0700 (PDT) Organization: http://groups.google.com Message-ID: NNTP-Posting-Host: 86.75.149.112 Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1256716279 6495 127.0.0.1 (28 Oct 2009 07:51:19 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 28 Oct 2009 07:51:19 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: k19g2000yqc.googlegroups.com; posting-host=86.75.149.112; posting-account=vrfdLAoAAAAauX_3XwyXEwXCWN3A1l8D User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; fr),gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:8823 Date: 2009-10-28T00:51:19-07:00 List-Id: Hello Ada Artists, I was reading the Ada 95 Quality and Style Guide, seeking for some inspiration about a design / style doubt. I came into Chapter 5, =93 CHAPTER 5: Programming Practices =94, 5.3.4 Subprogram Access Types says : > You can achieve the same effect as access-to-subprogram types for > dynamic selection by using abstract tagged types. You declare an > abstract type with one abstract operation and then use an > access-to-class-wide type to get the dispatching effect. This technique > provides greater flexibility and type safety than access-to-subprogram ty= pes Here : http://www.iste.uni-stuttgart.de/ps/ada-doc/style_guide/sec_5a.html#= 5.3.4 I agree about the =93 greater flexibility=94 (I've recently meet such a case), but I do not understand the =93 and [greater] type safety =94. If it's Ok for me to assert that tagged type is a more flexible way than access to subprogram, I do not see a case where access to subprogram would be less type safe than tagged type. If there is something I do not understand, this may means I have something to learn about it (the purpose of the question then). Does any one know a case which match this assertion ? Have a nice October day