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 X-Google-Thread: 103376,ad06d2d7cb045687 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Received: by 10.68.238.198 with SMTP id vm6mr14474960pbc.3.1328030938303; Tue, 31 Jan 2012 09:28:58 -0800 (PST) Path: lh20ni245524pbb.0!nntp.google.com!news1.google.com!news.glorb.com!feeder.erje.net!news2.arglkargh.de!news.mixmin.net!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: =?utf-8?B?U2lsbHkgYW5kIHN0dXBpZCBwb3N04oCRY29uZGl0aW9uIG9yIG5vdMKgPw==?= Date: Tue, 31 Jan 2012 18:28:54 +0100 Organization: cbb software GmbH Message-ID: <1p9stpwo0k4ma$.1hznr6by4cbdt$.dlg@40tude.net> References: Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: I2klQPiYGQJwDYDOx8fKzw.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit Date: 2012-01-31T18:28:54+01:00 List-Id: On Tue, 31 Jan 2012 00:11:43 +0100, Yannick Duch�ne (Hibou57) wrote: > type Parsed_Type (Status : Parsed_Status_Type) is record > case Status is > when Parsed => > Instance : Instance_Type; > when Format_Error => > null; > end case; > end record; -- Parsed_Type > > function Parsed (S : String) return Parsed_Type > with Post => > (if S'Length not in Image_Length_Type then > Parsed'Result.Status = Format_Error); > -- There may be other failure conditions. Returning the discussion from the astral spheres back to the topic. A better design could be to split Format_Error into Length_Error and other errors. Then for Parsed the postcondition would become complete for one case: if and only if S'Length not in Image_Length_Type then the result is Length_Error. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de