From: Robert A Duff on 8 Feb 2010 09:56 "Hibou57 (Yannick Duch�ne)" <yannick_duchene(a)yahoo.fr> writes: > So, with absolute majority, the Gang Of Three voted there is a flaw > here Make that four. ;-) Private parts are a kludge in the first place, and the way they work with public protected types is even worse, as you pointed out. However, I think you can get the hiding you want by using a protected or synchronized interface. - Bob
From: Robert A Duff on 8 Feb 2010 10:17 "Dmitry A. Kazakov" <mailbox(a)dmitry-kazakov.de> writes: > Yes, OK. Maybe it is not so offending as private components of a protected > type, but you are right. "C++-ish" notation (wasn't it actually before > C++?) poison is at work here as well. According to this: http://research.scee.net/files/presentations/gcapaustralia09/Pitfalls_of_Object_Oriented_Programming_GCAP_09.pdf C++ development started in 1979, and was named "C++" in 1983. Ada development started in the late 70's (not sure exactly, probably before 1979), and was named "Ada" before 1983. So I think Ada slightly predates C++. It also says C++ was standardized in 1998. Is that right? I'm surprised it was so late... Ada was first standardized in 1983. IIRC, Ada 83 tasks did not have private parts, and protected types did not exist. Packages had private parts. They were a mistake, IMHO. But I don't think it's fair to blame Bjarne Stroustrup for this mistake. ;-) - Bob
From: Dmitry A. Kazakov on 8 Feb 2010 10:36 On Mon, 08 Feb 2010 09:56:42 -0500, Robert A Duff wrote: > However, I think you can get the hiding you want by using > a protected or synchronized interface. Right, it is better now with Ada 2005. Nevertheless it is not too late to add the "standard" Ada syntax for task and protected types declarations leaving the old one supported for compatibility reasons. I mean type T is task { private | record ... }; type S is protected { private | record ... }; -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de
From: Robert A Duff on 8 Feb 2010 11:06 "Dmitry A. Kazakov" <mailbox(a)dmitry-kazakov.de> writes: > On Mon, 08 Feb 2010 09:56:42 -0500, Robert A Duff wrote: > >> However, I think you can get the hiding you want by using >> a protected or synchronized interface. > > Right, it is better now with Ada 2005. > > Nevertheless it is not too late to add the "standard" Ada syntax for task > and protected types declarations leaving the old one supported for > compatibility reasons. I mean > > type T is task { private | record ... }; > type S is protected { private | record ... }; What were they thinking?! The "task type T is..." syntax is so obviously broken. The protected syntax just copied that mistake, so it's not a mistake by itself. Unfortunately, we can't simplify the language by replacing the old syntax -- as you say, it's needed for compatibility. - Bob
From: (see below) on 8 Feb 2010 11:15
On 08/02/2010 15:17, in article wccr5ovkb9f.fsf(a)shell01.TheWorld.com, "Robert A Duff" <bobduff(a)shell01.TheWorld.com> wrote: .... > IIRC, Ada 83 tasks did not have private parts, and protected types > did not exist. Packages had private parts. They were a mistake, > IMHO. But I don't think it's fair to blame Bjarne Stroustrup for > this mistake. ;-) I guess we have to blame Jean Ichbiah? 8-) Strangely, LIS, his ancestor of Ada, did not do this but had distinct, separately compiled, interface, representation, and algorithm parts for the LIS equivalent of packages. I wonder what the rationale was for merging the first two. I suspect compiler efficiency worries, valid at the time, that now are obsolete. -- Bill Findlay <surname><forename> chez blueyonder.co.uk |