From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Your wish list for Ada 202X Date: Tue, 22 Apr 2014 10:02:28 +0200 Organization: cbb software GmbH Message-ID: <11241mc0j3ewn.14ahwtra3l1i8.dlg@40tude.net> References: <7f1c01c5-3563-4b94-9831-152dbbf2ecdc@googlegroups.com> <1aa804jg9qq4o$.wdiq33yo621l.dlg@40tude.net> <1w6eh0aiksmdh$.1h16p7y0b8c6h.dlg@40tude.net> <17twpp4p8u7o$.1idvzaaio4f3t$.dlg@40tude.net> <1wjmcbk375lzk.6o7dpqcp3va3.dlg@40tude.net> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: G+aXx1XI67D34t54ibhUPQ.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Xref: news.eternal-september.org comp.lang.ada:19487 Date: 2014-04-22T10:02:28+02:00 List-Id: On Mon, 21 Apr 2014 18:09:46 -0500, Randy Brukardt wrote: > Yes, that works. But still, you probably don't have too many Open operations > that close objects. :-) As I said, I've found that it's common that you need > to override all of the Open operations (because they all need to set a new > component, for instance, or call a different Open routine that does that), > or the original versions are all good enough. Perhaps that's different if > multiple inheritance gets involved, but it certainly seems true for single > inheritance. But there should be no Open operation at all. The object must be functional in each its state. Open is not an operation it is a part of the object's constructor. This is another language problem that Ada forces you to introduce Open, which adds unusable object states (not yet opened object), must be overridden (but there is no way to spell that requirement), must call to the parent's Open (but. again, no way to ensure that). Not every instance of bad design is due to the programmer's malice. P.S. With MD Open will dispatch on File and on Path (path must be MI from character set and a path|plain name|volume and absolute|relative hierarchies) and, possibly, on additional parameter types. All variants must be overridden!.. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de