comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Studying and Maintaining GNAT, Is There Any Interest in a New Group?
Date: Tue, 4 Sep 2018 17:18:08 -0500
Date: 2018-09-04T17:18:08-05:00	[thread overview]
Message-ID: <pmn0b1$8dg$1@franka.jacob-sparre.dk> (raw)
In-Reply-To: pmg5ec$rr7$1@gioia.aioe.org

"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message 
news:pmg5ec$rr7$1@gioia.aioe.org...
> On 2018-09-01 00:42, Randy Brukardt wrote:
...
>>> BTW, I prefer to fold constants before generating the tree. I.e. when
>>> Evaluate is called it returns either a value ("constant" node) or a new
>>> "dynamic" node.
>>
>> In Ada, you can't do folding until you know what the operations are, and 
>> you
>> don't know that until after resolution (that is, "*" could be predefined,
>> which you can fold, or user-defined, which you probably can't fold, and
>> certainly can't treat as static).
>
> I meant folding universal constants. During/after type resolution one 
> could generate the next tree and fold resolved constants then.

Ystill can't fold those in Ada. Consider:

       A : constant Saturated := 2 + 2;

You can't fold "2 + 2" without doing resolution first, since Ada says that a 
user-defined "+" operator would be used here (which is probably the case for 
a Saturated type). It's pretty rare that the universal operations get used 
in Ada code. To fold this expression (assuming a typical implementation for 
saturated "+"), you'd have resolve the expression, inline the "+" code, and 
then fold that.

...
>> I have a different vision of static verification than you do; I'm 
>> primarily
>> focused on static verification of Ada's dynamic checks. (Since that 
>> includes
>> pragma Assert and the like, you can verify almost everything this way.)
>
> It is OK, but low-level. One cannot organize such checks in a way of type 
> checks,  which have inheritance, parameter matching, composition of new 
> types. You lose a lot. Not everything can be checked by types, of course.

Well, actually, class-wide preconditions/postconditions do in fact have 
those characteristics. Of course, you need an OO design to take advantage of 
that -- but the point is you don't have to do *everything* with types.

                               Randy.



  reply	other threads:[~2018-09-04 22:18 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-25 12:27 Studying and Maintaining GNAT, Is There Any Interest in a New Group? patrick
2018-08-25 13:56 ` Dan'l Miller
2018-08-25 16:00   ` patrick
2018-08-25 16:16 ` Luke A. Guest
2018-08-25 17:42   ` patrick
2018-08-25 19:25     ` Simon Wright
2018-08-25 20:24       ` patrick
2018-08-25 21:48         ` Luke A. Guest
2018-08-25 21:53           ` patrick
2018-08-25 22:05             ` Luke A. Guest
2018-08-26 19:54           ` Dan'l Miller
2018-08-26 20:14             ` Dan'l Miller
2018-08-26 22:52             ` Lucretia
2018-08-27  2:38               ` Dan'l Miller
2018-08-27 14:46                 ` Lucretia
2018-08-27 15:42                   ` Dan'l Miller
2018-08-27 21:27               ` Randy Brukardt
2018-08-28  7:26                 ` Dmitry A. Kazakov
2018-08-29  0:16                   ` Randy Brukardt
2018-08-29  8:20                     ` Dmitry A. Kazakov
2018-08-29 21:43                       ` Randy Brukardt
2018-08-30  7:55                         ` Dmitry A. Kazakov
2018-08-30 23:25                           ` Randy Brukardt
2018-08-31  8:48                             ` Dmitry A. Kazakov
2018-08-31 22:42                               ` Randy Brukardt
2018-09-02  8:02                                 ` Dmitry A. Kazakov
2018-09-04 22:18                                   ` Randy Brukardt [this message]
2018-08-29  3:02                 ` Paul Rubin
2018-08-29  6:18                   ` Luke A. Guest
2018-08-29 19:00                     ` Paul Rubin
2018-08-30  5:54                       ` Luke A. Guest
2018-08-30  6:29                         ` Paul Rubin
2018-08-27 21:18             ` Randy Brukardt
2018-08-27  9:37           ` Simon Wright
2018-08-27 16:54             ` Bill Findlay
2018-08-27 17:42               ` Shark8
2018-08-31 21:23                 ` Robert A Duff
2018-08-31 22:51                   ` Randy Brukardt
2018-09-01 19:42                     ` Robert A Duff
2018-09-02  8:04                       ` Dmitry A. Kazakov
2018-09-02 10:11                     ` AdaMagica
2018-09-02 12:10                       ` Jeffrey R. Carter
2018-09-02 14:30                         ` AdaMagica
2018-09-04 22:05                           ` Randy Brukardt
2018-09-01  7:41               ` Simon Wright
2018-09-01 17:27                 ` Bill Findlay
2018-08-27 17:35         ` Shark8
2018-08-25 21:17       ` Luke A. Guest
2018-08-25 23:16       ` Paul Rubin
2018-08-26  8:03         ` Rene
2018-08-26 10:09         ` Simon Wright
2018-08-25 16:43 ` Jeffrey R. Carter
2018-08-25 17:38   ` patrick
2018-08-25 17:39     ` Luke A. Guest
2018-08-25 17:45       ` patrick
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox