comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Is this a bug?
Date: Fri, 3 Jan 2020 09:37:28 +0100
Date: 2020-01-03T09:37:28+01:00	[thread overview]
Message-ID: <qumug8$1bsj$1@gioia.aioe.org> (raw)
In-Reply-To: 8bc80421-29fb-4f19-baf0-b14680a99c32@googlegroups.com

On 2020-01-03 08:35, reinert wrote:
> torsdag 2. januar 2020 10.34.17 UTC+1 skrev Dmitry A. Kazakov følgende:
>> On 2019-12-31 22:50, Randy Brukardt wrote:
>>
>>> The best possible fix here would be to find some alternative notation for
>>> record components so that there would be a work-around in case the primary
>>> notation doesn't work.
>>
>>      A'Component (B)
>>
>>      B of A
>>
>> etc for A.B.
>>
>> -- 
>> Regards,
>> Dmitry A. Kazakov
>> http://www.dmitry-kazakov.de
> 
> But I kind of like the concept of "extending" the record as illustrated here:
> 
> type rec1_t is tagged record
>     a : Integer := 2;
>     b : integer := 2;
> end record;
> function c(x: rec1_t) return Integer is (x.a + x.b);
> rec1 : rec1_t;
> 
> And then rec1.c = 4 is true.
> 
> But what is really the problem of prohibiting to include above:
> 
> function a(x: rec1_t) return Integer is (5);
> 
> ?
> 
> This is similar to that the following is not legal:
> 
> type rec1_t is tagged record
>     a : Integer := 2;
>     b : Integer := 2;
>     a : Integer := 5; -- is not legal.
> end record;
> 
> ?

Yes, but that is was not possible, because in Ada 95 the function "a" 
did not conflict with members. The change in Ada 2005 introduced dot 
notation and thus the conflict.

What Randy meant is a different issue that there is no "fully qualified" 
form to get a record member since Ada 2005 change made "." overloaded.

If "." were a first-class operation, then one would have it:

    "." (X, "a")   vs   a (X)

Such operation could be very difficult to introduce.

    X'Component (A)

or

    A of X

are much simpler.

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


  reply	other threads:[~2020-01-03  8:37 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-30 15:44 Is this a bug? reinert
2019-12-30 17:51 ` Anh Vo
2019-12-30 18:41   ` Niklas Holsti
2019-12-30 19:50     ` reinert
2019-12-30 20:11       ` Dmitry A. Kazakov
2019-12-30 23:16     ` Randy Brukardt
2019-12-31 19:40       ` Optikos
2019-12-31 21:50         ` Randy Brukardt
2020-01-02  9:34           ` Dmitry A. Kazakov
2020-01-03  7:26             ` reinert
2020-01-03  7:35             ` reinert
2020-01-03  8:37               ` Dmitry A. Kazakov [this message]
2020-01-04  0:42                 ` Randy Brukardt
2020-01-05 13:32                   ` reinert
2020-01-06 10:43                     ` J-P. Rosen
2020-01-06 12:19                       ` Tero Koskinen
2020-01-17  9:54                 ` reinert
2020-01-17 10:08                   ` Dmitry A. Kazakov
2020-01-17 22:14                   ` Randy Brukardt
2019-12-31  6:08     ` J-P. Rosen
  -- strict thread matches above, loose matches on Subject: below --
2004-09-23  0:52 Wojtek Narczynski
2004-09-23  8:35 ` Wojtek Narczynski
2004-09-23 14:52   ` Nick Roberts
2004-09-23 22:26     ` Brian May
2004-09-24  0:28       ` Stephen Leake
2004-09-24  0:57         ` Jeffrey Carter
2004-09-24 12:47         ` Wojtek Narczynski
2004-09-25  0:17           ` Brian May
2004-09-24 12:37       ` Wojtek Narczynski
2004-09-23 11:27 ` Jeff C r e e.m
2004-09-24  0:30   ` Stephen Leake
2004-09-24  1:49     ` Jeff C r e e.m
2004-09-25 12:59       ` Stephen Leake
2004-10-04 16:36         ` Warren W. Gay VE3WWG
replies disabled

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