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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 Path: border2.nntp.dca3.giganews.com!backlog4.nntp.dca3.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!peer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post01.iad.highwinds-media.com!fx07.iad.POSTED!not-for-mail From: Shark8 User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:31.0) Gecko/20100101 Thunderbird/31.0a1 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Your wish list for Ada 202X 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> <11241mc0j3ewn.14ahwtra3l1i8.dlg@40tude.net> In-Reply-To: <11241mc0j3ewn.14ahwtra3l1i8.dlg@40tude.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: X-Complaints-To: abuse@teranews.com NNTP-Posting-Date: Tue, 22 Apr 2014 08:30:17 UTC Organization: TeraNews.com Date: Tue, 22 Apr 2014 02:30:17 -0600 X-Received-Bytes: 2666 X-Received-Body-CRC: 3115690888 X-Original-Bytes: 2908 Xref: number.nntp.dca.giganews.com comp.lang.ada:185931 Date: 2014-04-22T02:30:17-06:00 List-Id: On 22-Apr-14 02:02, Dmitry A. Kazakov wrote: > But there should be no Open operation at all. Why not? It seems to me that Open could be ideal for some object, like say an object representing flood-gates, or an internally used operation for an "e-mail reader", or dozens of other things (perhaps file processing [e.g. Get_File_List, Filter, Open as basic 'operations' of the processor]). > The object must be functional in each its state. Open is not an > operation it is a part of the object's constructor. Again, see the above. -- I realize you're talking about _files_, but there's many more things that could need an 'open' than just files. {Moreover, 'open' might even be hidden in the implementation.} > 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 entirely true; with pre/post conditions, and perhaps type-invariants you can prohibit such states from being entered (which will result in an exception).