comp.lang.ada
 help / color / mirror / Atom feed
* Tagged type more type safe than access to subprogram ?
@ 2009-10-28  7:51 Hibou57 (Yannick Duchêne)
  2009-10-28  8:55 ` Dmitry A. Kazakov
  0 siblings, 1 reply; 6+ messages in thread
From: Hibou57 (Yannick Duchêne) @ 2009-10-28  7:51 UTC (permalink / 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



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-10-30  8:25 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-28  7:51 Tagged type more type safe than access to subprogram ? Hibou57 (Yannick Duchêne)
2009-10-28  8:55 ` 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

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