comp.lang.ada
 help / color / mirror / Atom feed
From: Jere <jhb.chat@gmail.com>
Subject: Prefixed notation for non tagged types
Date: Sun, 17 Dec 2017 05:47:46 -0800 (PST)
Date: 2017-12-17T05:47:46-08:00	[thread overview]
Message-ID: <427478f8-298f-49b3-9cc1-4cfd58da6bd4@googlegroups.com> (raw)
In-Reply-To: <ojettn$g18$1@franka.jacob-sparre.dk>

On Monday, July 3, 2017 at 10:18:33 PM UTC-4, Randy Brukardt wrote:
> "Jere" wrote in message 
> > On Sunday, July 2, 2017 at 8:04:56 PM UTC-4, Randy Brukardt wrote:
> >> (3) Since prefixed notation does automatic dereferencing and referencing
> >> (that is, .all and 'Access), allowing it on all types caused levels of
> >> ambiguity (and potentially infinite regress). It was easier to just 
> >> define
> >> it on tagged types, which didn't have those issues. Perhaps it could have
> >> been made to work, but it was more work for a feature that already had
> >> significant opposition; probably it would have been dropped rather than
> >> getting more complicated. (Sound like a broken record??)
> >
> > Was there any consideration to having prefixed notation to
> > apply to all record types and add a way to denote that a private
> > type is a record type (there should be many ways to do that)?
> > We don't really need it on all types, just record types.
> 
> Not that I recall, but requiring an indication that a private type is 
> completed by a record seems like noise (99% of private types are completed 
> by some sort of record as it is). It would be better the other way around 
> (indicate when it is *not* completed by a record), but of course that would 
> be incompatible. Still seems best for Ada'Succ.
> 
>                                           Randy.

I know this is an old email chain, but I've been thinking about this
more recently.  For background, I asked if there could be a way to
denote that a private type was a record type, so that Prefixed notation
could be used on non tagged types.  Randy noted that since most private 
types were record types, it would just be noise.  I wanted to revisit
this thought.  Forgive me if there is a good way to split the chain.
I don't know how to do that.  

So with that in mind:
My inclination is that the noise is already there.  I generally like
prefixed notation (it is easier for me to discern what is going on
when I read it), so even though I don't really like providing extension
for a type, I find myself making types tagged just to get the
prefixed notation.  In essence, I am already adding noise.  I think
my suggestion is that the noise could be replaced.  Instead of
having to mark any type where I want that notation (I don't do
it to all types) as tagged, have some other method that allows for
the ada compiler to confirm the full view is a record but also allow
for the prefixed notation in partial public view.

I like to keep extension out of many types that I wante prefixed
notation on.  I don't want the baggage that tagged types come with
unless I am actually utilizing those features.  I'm sure there are
a ton of ways to do this:

1.  use the not keyword in conjunction with tagged:
type My_Type is not tagged limited private;

I don't like this at all but just saying it is an option.  I think
it conveys a confusing meaning to the type.

2.  new keyword
type My_Type is <new keyword> limited private;

I don't really like adding new keywords either...though the option is
there I guess.  Something like the "final" keyword that says it was
tagged but can no longer be extended or some keyword completely
unrelated to tagged-ness.

3.  change up record declarations to use "record" in the partial view:
type My_Type is limited private record;

My guess is this would be difficult for compiler writers though as 
record is used for starting a declaration block.

4.  maybe an aspect
type My_Type is limited private
with
   Prefixed_Notation => True;  -- or some other aspect name

Here I am unsure if this is a good fit or not.  I don't have a good
feel for the boundaries of what aspects should be used for.

5.  maybe an attribute
type My_Type is limited private;
for My_Type'Prefixed_Notation use True;  -- or some other name

Same thoughts as #4 but I feel even more strongly that this would
be odd.

Maybe some other options.  My key point is that there already exists
noise out there for this and it comes with features that the designer
may not want to expose in the process.  Maybe there is a better way
to handle it.  I realize that if the feature existed others that didn't
mark types tagged for prefix notation would possibly use it, but I think
that is more of an indication of why it should be explored further.

Anyone have any thoughts?


  reply	other threads:[~2017-12-17 13:47 UTC|newest]

Thread overview: 116+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-21  1:12 Ada Annoyances pythoner6
2017-06-21 10:13 ` Lucretia
2017-06-23 15:27   ` raph.amiard
2017-06-23 17:49     ` Randy Brukardt
2017-06-23 19:21       ` Niklas Holsti
2017-06-24  4:02         ` Shark8
2017-06-24 19:55         ` Simon Wright
2017-06-24 20:56           ` Niklas Holsti
2017-06-25 23:43         ` Randy Brukardt
2017-06-26 20:20           ` Niklas Holsti
2017-06-26 21:47             ` Randy Brukardt
2017-06-26 22:23               ` Dmitry A. Kazakov
2017-06-29 19:00               ` Niklas Holsti
2017-06-29 21:29                 ` Robert A Duff
2017-06-30  0:50                   ` Randy Brukardt
2017-07-03 20:39                     ` Robert A Duff
2017-07-04 19:52                       ` Niklas Holsti
2017-07-04 19:32                   ` Niklas Holsti
2017-06-30  0:47                 ` Randy Brukardt
2017-06-30 18:45                   ` Niklas Holsti
2017-06-30 20:06                     ` Robert A Duff
2017-06-29 21:12         ` Robert A Duff
2017-07-04 19:30           ` Niklas Holsti
2017-07-05 20:03             ` Robert A Duff
2017-06-23 19:22       ` Niklas Holsti
2017-06-30 15:02       ` Norman Worth
2017-06-30 23:49         ` pythoner6
2017-07-03  0:04           ` Randy Brukardt
2017-07-03 17:47             ` Jere
2017-07-03 19:43               ` Dmitry A. Kazakov
2017-07-04  2:18               ` Randy Brukardt
2017-12-17 13:47                 ` Jere [this message]
2017-12-17 15:06                   ` Prefixed notation for non tagged types Simon Wright
2017-12-17 15:33                     ` Dmitry A. Kazakov
2017-12-18 22:31                     ` Randy Brukardt
2017-12-19  0:40                     ` Jere
2017-12-19 23:04                       ` Randy Brukardt
2017-12-20 12:33                         ` Robert Eachus
2017-06-21 11:58 ` Ada Annoyances joakimds
2017-06-21 12:29   ` Pascal Obry
2017-06-21 14:52     ` pythoner6
2017-06-21 16:11       ` J-P. Rosen
2017-06-21 16:12       ` Dmitry A. Kazakov
2017-06-21 22:45         ` pythoner6
2017-06-22  7:29           ` Dmitry A. Kazakov
2017-06-22 10:29             ` pythoner6
2017-06-22 11:04               ` Egil H H
2017-06-22 13:30               ` Dmitry A. Kazakov
2017-06-22 19:22                 ` Niklas Holsti
2017-06-22 21:52                   ` Dmitry A. Kazakov
2017-06-23  9:33                     ` AdaMagica
2017-06-23 10:25                       ` Simon Wright
2017-06-23  1:00                 ` pythoner6
2017-06-23 15:23         ` raph.amiard
2017-06-23 16:10           ` Dmitry A. Kazakov
2017-06-23 17:41           ` Randy Brukardt
2017-06-23 18:56           ` Maciej Sobczak
2017-06-23 22:18             ` pythoner6
2017-06-24  8:05               ` Dmitry A. Kazakov
2017-06-24  8:35                 ` Maciej Sobczak
2017-06-24  9:07                   ` Dmitry A. Kazakov
2017-06-24 20:50                     ` Maciej Sobczak
2017-06-24 21:06                       ` Dmitry A. Kazakov
2017-06-25 11:33                         ` Maciej Sobczak
2017-06-25 14:32                           ` Dmitry A. Kazakov
2017-06-25 20:50                             ` Maciej Sobczak
2017-06-26  7:58                               ` Dmitry A. Kazakov
2017-06-26 13:24                                 ` Maciej Sobczak
2017-06-26 16:38                                   ` Dmitry A. Kazakov
2017-06-26 20:42                                     ` Maciej Sobczak
2017-06-24  8:34               ` Maciej Sobczak
2017-06-24 13:06                 ` pythoner6
2017-06-24 15:40                   ` Dmitry A. Kazakov
2017-06-26  0:06                 ` Randy Brukardt
2017-06-26 20:35                   ` Maciej Sobczak
2017-06-26 21:40                     ` Randy Brukardt
2017-06-27  7:23                       ` Maciej Sobczak
2017-06-27 20:38                         ` Randy Brukardt
2017-06-28  8:21                           ` Dmitry A. Kazakov
2017-06-28 20:50                             ` Randy Brukardt
2017-06-28 23:18                               ` Nasser M. Abbasi
2017-06-29  7:27                                 ` Dmitry A. Kazakov
2017-06-29 16:24                                 ` Jeffrey R. Carter
2017-06-29 16:51                                   ` Nasser M. Abbasi
2017-07-04 23:40                                   ` Luke A. Guest
2017-07-05  5:29                                     ` J-P. Rosen
2017-07-05 13:49                                       ` Dennis Lee Bieber
2017-07-05 17:49                                     ` Jeffrey R. Carter
2017-06-29 21:46                                 ` darkestkhan
2017-06-29  7:15                               ` Dmitry A. Kazakov
2017-06-30  0:42                                 ` Randy Brukardt
2017-06-30  7:36                                   ` Dmitry A. Kazakov
2017-06-28 13:07                           ` Maciej Sobczak
2017-06-27  7:26                       ` Dmitry A. Kazakov
2017-06-27 20:41                         ` Randy Brukardt
2017-06-28  7:57                           ` Dmitry A. Kazakov
2017-06-27 15:19                     ` AdaMagica
2017-06-27 16:32                       ` Dmitry A. Kazakov
2017-06-28 13:15                       ` Maciej Sobczak
2017-06-28 14:05                         ` AdaMagica
2017-06-29 21:17                           ` Robert A Duff
2017-06-30  7:44                             ` Dmitry A. Kazakov
2017-06-30  7:49                               ` J-P. Rosen
2017-06-30  8:28                                 ` Dmitry A. Kazakov
2017-06-30 10:14                                   ` J-P. Rosen
2017-06-30 10:30                                     ` Dmitry A. Kazakov
2017-06-28 20:53                         ` Randy Brukardt
2017-12-17 16:24             ` Mehdi Saada
2017-12-17 17:27               ` Dmitry A. Kazakov
2017-12-18 23:09                 ` Randy Brukardt
2017-12-19  9:25                   ` Dmitry A. Kazakov
2017-06-21 20:40       ` G.B.
2017-06-21 22:25         ` pythoner6
2017-06-26 11:01     ` Vincent
2017-06-26 11:15       ` Alejandro R. Mosteo
2017-06-26 16:35       ` Pascal Obry
replies disabled

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