comp.lang.ada
 help / color / mirror / Atom feed
From: "Hibou57 (Yannick Duchêne)" <yannick_duchene@yahoo.fr>
Subject: Tagged type more type safe than access to subprogram ?
Date: Wed, 28 Oct 2009 00:51:19 -0700 (PDT)
Date: 2009-10-28T00:51:19-07:00	[thread overview]
Message-ID: <b1b16af6-8274-4b81-a993-9d8dd582ec74@k19g2000yqc.googlegroups.com> (raw)

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, “ CHAPTER 5: Programming Practices ”,

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 types
Here : http://www.iste.uni-stuttgart.de/ps/ada-doc/style_guide/sec_5a.html#5.3.4

I agree about the “ greater flexibility” (I've recently meet such a
case), but I do not understand the “ and [greater] type safety ”.

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



             reply	other threads:[~2009-10-28  7:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-28  7:51 Hibou57 (Yannick Duchêne) [this message]
2009-10-28  8:55 ` Tagged type more type safe than access to subprogram ? Dmitry A. Kazakov
2009-10-29 11:00   ` Hibou57 (Yannick Duchêne)
2009-10-29 17:54     ` Dmitry A. Kazakov
2009-10-29 20:45       ` Georg Bauhaus
2009-10-30  8:25         ` Dmitry A. Kazakov
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox