"Vincent" wrote in message news:701370ff-559b-458f-a107-793095a15749@googlegroups.com... >Le vendredi 3 juillet 2015 02:04:50 UTC+2, Randy Brukardt a écrit : > >> 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. > >Yes it is possible, but it is more work, since one has to encapsulate the >access >type into a "handle object". Access type? It depends on the problem, of course, but 90% of OOP objects need no access type, named that or anything else (handle, cursor, etc.). If you think you need one (of *any* sort), you probably are still confused by the C++/Java model. Claw (windowing interface for Windows) doesn't expose handles of any sort for windows and most of the other object types (I would have said all, but I'd don't recall the exact way the menus work). It only exposes objects of various types (windows/controls, canvases, menus, etc.) >The pity is that this work is not done by the compiler, through a proper >language >defined mecanism. (This is what I think of when I speak of a "class type"). Well, there's little point for there to be a language-defined mechanism for something that you don't even need. In addition, if one properly defines their OOP without using access types, then one can use the indefinite containers to provide handles in the event that some are needed. That's much better than raw access types, as memory management and (usually) dangling handle checking is included for free. >And even if you and I call it nonsense to use access types everywhere in >case of >polymorphism, many textbooks present it as the normal Ada way of Advanced >OOP. Many textbooks? There aren't "many textbooks" for Ada in the first place. I only know of a handful that discuss Ada OOP. > Therefore, I maintain that the "tagged type" concept of Ada 95 was, at > least, > incomplete, not to say awkward. Therefore, I maintain that you're still confused about how to use Ada OOP. That's OK, lots of others are as well. :-) Randy.