wrote in message news:58f64fa9-7d0b-44dd-870c-77d9afcb82c4@googlegroups.com... Le lundi 22 juin 2015 20:27:17 UTC+2, Shark8 a écrit : >> >> Yes, anonymous accesses ARE pretty bad. >> But this does bring up the question: what missteps have been made in >> Ada's design? >> > >I regard the refusal to create a "class type", like Ichbiah wanted it, just >like we have a > protected type and a task type, as the root of evil. The type Ichbiah wanted was syntactic sugar only. The semantics would have been very similar to that of tagged types. The primary difference would have been that we wouldn't have had to wait for Ada 2005 to get prefix calls. > For the OOP concept is based on > an interface that is the same and instances that are different > realizations of the same > concept. So we need to have two objects : >- a class object that is an interface and manage memory (a descendant of >controlled type) >- an instance object that is polymorphic. > >One may think that the distinction between class type and tagged type is >subtle, but the >implications of it are huge : without class object one needs as replacement >access to a >class wide type. This has led to the use of access values everywhere when >doing OOP. >To ease the pain access parameters and anonymous access types were >introduced... This seems to me to be nonsense. There's no need to use access types in Ada OOP interfaces; "in out T" and "access T" have virtually the same semantics when T is a tagged type. (Claw only has one access type in its entire interface, used for a return type that ought to be by reference. Everything else does not use visible access types.) It's more work this way, but it's definitely possible. The reason Ada has anonymous access parameters was a desire (for Ada 9x) that code from existing OOP languages like C++ could be directly converted to Ada without having to think at all (thinking being necessary to get rid of access types). Randy.