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 X-Received: by 2002:a5e:8a07:: with SMTP id d7mr9432937iok.7.1554101994493; Sun, 31 Mar 2019 23:59:54 -0700 (PDT) X-Received: by 2002:a9d:6a1a:: with SMTP id g26mr46309859otn.16.1554101994215; Sun, 31 Mar 2019 23:59:54 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!weretis.net!feeder6.news.weretis.net!feeder.usenetexpress.com!feeder-in1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!78no437127itl.0!news-out.google.com!r82ni517ita.0!nntp.google.com!136no436312itk.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sun, 31 Mar 2019 23:59:53 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=87.154.205.191; posting-account=3zVVBwoAAAC7BSMfgNP7DSbqU9urpt40 NNTP-Posting-Host: 87.154.205.191 References: <36c2ff61-8cca-4435-995f-dfc34fa44b69@googlegroups.com> <511923fb-dbb9-4e33-82a8-b4bbbf002a6d@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <5762bd48-9e87-4b77-a517-a4e62dec071b@googlegroups.com> Subject: Re: type definition for an integer with discrete range From: mario.blunk.gplus@gmail.com Injection-Date: Mon, 01 Apr 2019 06:59:54 +0000 Content-Type: text/plain; charset="UTF-8" Xref: reader01.eternal-september.org comp.lang.ada:56023 Date: 2019-03-31T23:59:53-07:00 List-Id: On Saturday, March 30, 2019 at 11:13:14 PM UTC+1, Jere wrote: > On Saturday, March 30, 2019 at 4:44:07 PM UTC-4, mario.b...@gmail.com wrote: > > Great, that brings me a lot further. I updated the file at > > https://github.com/Blunk-electronic/ada_training/blob/master/src/type_angle/type_angle.adb > > Two more questions: > > 1. How can I catch the exception SYSTEM.ASSERTIONS.ASSERT_FAILURE in the exception handler ? See line 26. > > 2. How can I print the "gap size" via put ? See line 28. > > > > Thanks to all of you out there. > > 1. Add a "with" for System.Assertions, uncomment line 26, add your > handling code. > > 2. Declare a constant: > Angle_Delta : constant := 5; > Use it in your Dynamic_Predicate and then in your print statement, do > Integer'Image(Angle_Delta); Thanks, it is nearly perfect now :-) The line 24 in the file https://github.com/Blunk-electronic/ada_training/blob/master/src/type_angle/type_angle.adb Should produce an error at compile time. Apart from this "nice to have" the program does what I want.