comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Augusta: An open source Ada 2012 compiler (someday?)
Date: Fri, 28 Mar 2014 09:56:12 +0100
Date: 2014-03-28T09:56:12+01:00	[thread overview]
Message-ID: <rjff5apgbxar.1w2v1chy8x2pp$.dlg@40tude.net> (raw)
In-Reply-To: 89a0ea84-83e2-4693-b2ea-ea9da65bbc73@googlegroups.com

On Thu, 27 Mar 2014 13:38:16 -0700 (PDT), Lucretia wrote:

> i.e. 1) add exception records
> 
> type E is exception
>    record
>       My_Data : Integer;
>    end record;

You will have a problem catching such exceptions because in Ada exceptions
are "values" not "types", like in C++.

That they are "value" among other allows enumeration like:

   when Error : Constraint_Error | Data_Error =>

If Constraint_Error and Data_Error were "types" what would be the type of
Error? You could move to classes of exceptions but that still would not
allow simple enumerations when instances are not siblings.

A related problem is renaming of exceptions. A renaming produce a new
object, but you still can catch it under original name because the result
has same "value."

In general if exceptions form a tree of related types you have a problem of
choosing between sets, possibly nested sets of types in exception handlers.
C++ does this by linear matching exceptions in the order they appear. This
is a mess.

> 2) User defined types having 'Image and 'Value, which call a subprogram
> which must be defined if these attributes are to be used - much like the
> stream operations do.

They should be primitive operations instead.

But the actual problem here is MD. It works with stream attributes through
cascaded dispatch *only* because streams enforce Stream_Element on all
implementations which decompose objects into Stream_Element_Arrays. This is
the reason why a stream attribute can *first* dispatch on the object type
and *then* on the stream. For 'Image and 'Value it would not work in
presence of Character, Wide_Character, Wide_Wide_Character. That is full
MD, or else you have to restrict it to single character type.
 
> 3) Replace tagged with just class, so:
> 
> type C is
>    class
>       ...
>    end class;

Class is not a type. Class is a set of types. A class can have a
"representative" type, which is already named in Ada as T'Class.

In short, you need not to specify that some type may be member of a class.
All types may. Why not?

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

  parent reply	other threads:[~2014-03-28  8:56 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-19 13:24 Augusta: An open source Ada 2012 compiler (someday?) Peter Chapin
2014-03-19 18:56 ` Tero Koskinen
2014-03-19 23:02   ` Peter Chapin
2014-03-20 18:13   ` Shark8
2014-03-20 22:41     ` Augusta: An open source Ada 2012 compiler (someday?) (Off topic) erlo
2014-03-20 23:21       ` Randy Brukardt
2014-03-19 23:04 ` Augusta: An open source Ada 2012 compiler (someday?) Brian Drummond
2014-03-19 23:24   ` Peter Chapin
2014-03-20  0:00     ` Brian Drummond
2014-03-20 18:35   ` Shark8
2014-03-22 14:30     ` Brian Drummond
2014-03-20 10:23 ` Lucretia
2014-03-20 10:49   ` J-P. Rosen
2014-03-20 23:15     ` Randy Brukardt
2014-03-24  8:18       ` J Kimball
2014-03-24  9:17         ` Thomas Løcke
2014-03-24 10:00           ` Brian Drummond
2014-03-24 14:16           ` Luke A. Guest
2014-03-24 12:51         ` Peter Chapin
2014-03-24 21:21         ` Randy Brukardt
2014-03-24 23:18           ` Dennis Lee Bieber
2014-03-24 23:50             ` J Kimball
2014-03-25  9:37           ` Stefan.Lucks
2014-03-25 20:47             ` Randy Brukardt
2014-03-25 19:41         ` Michael B.
2014-03-26  1:50           ` Shark8
2014-03-26 20:39             ` Simon Clubley
2014-03-27  9:32               ` Shark8
2014-03-27 20:02                 ` Simon Clubley
2014-03-27 20:38                   ` Lucretia
2014-03-27 21:51                     ` Niklas Holsti
2014-03-27 22:32                       ` Luke A. Guest
2014-03-28  5:12                         ` Shark8
2014-03-28  5:11                           ` J Kimball
2014-03-28  8:06                         ` Georg Bauhaus
2014-03-28 11:31                       ` Peter C. Chapin
2014-03-31 23:43                         ` Randy Brukardt
2014-03-28  8:56                     ` Dmitry A. Kazakov [this message]
2014-03-28 19:20                   ` Dan'l Miller
2014-03-28 20:40                     ` Dmitry A. Kazakov
2014-03-29 12:34                       ` Dan'l Miller
2014-03-29 13:36                         ` Dmitry A. Kazakov
2014-03-29 12:42                       ` Dan'l Miller
2014-03-29  0:15                     ` Peter Chapin
2014-03-29  3:39                       ` Shark8
2014-03-29  8:46                       ` Georg Bauhaus
2014-03-29 16:35                         ` Peter Chapin
2014-03-29  9:51                       ` Georg Bauhaus
2014-03-20 19:03   ` Shark8
2014-03-20 18:10 ` Shark8
2014-03-20 18:20   ` Qun-Ying
replies disabled

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