comp.lang.ada
 help / color / mirror / Atom feed
From: Niklas Holsti <niklas.holsti@tidorum.invalid>
Subject: Re: syntaxic exploration
Date: Sat, 23 Dec 2017 09:15:35 +0200
Date: 2017-12-23T09:15:35+02:00	[thread overview]
Message-ID: <fa6e4mF30lmU1@mid.individual.net> (raw)
In-Reply-To: <p1k2af$n1q$1@gioia.aioe.org>

On 17-12-23 00:51 , Dmitry A. Kazakov wrote:
> On 2017-12-22 23:11, Niklas Holsti wrote:
>
>> I think the aggregate form (null array) was suggested some time ago,
>> in analogy with the existing (null record).
>
> These two totally different things. "null record" is not a record
> aggregate (a value of record type), it is a type construct (a value of a
> record type's type).

Yes and no. Compare

    type Nothing is null record;  -- Last choice in RM 3.8(3).

and

    N : Nothing := (null record);  -- Last choice in RM 4.3.1(3).

So "null record" in a type declaration is a record_definition (RM 
3.8(3)) but it can also occur in an expression as a 
record_component_association_list (RM 4.3.1(3)). Thus "(null record)" is 
a record aggregate.

> Correspondingly "null array" would mean a type of
> arrays rather than an empty aggregate of an array type.
>
>> I think (null array) satisfies that. I wish it could be introduced.
>
> If "" is QK, why () isn't?

Could be, but parentheses are already so overloaded (which quotes are 
not) that I like (null array) better.

> It could be an attribute as well:
>
>    Empty : My_Array := My_Array'Null;

Could be, but it is not much better than My_Array'(null array).

> (You are right about indices. String has the lower bound set to 1. That
> gives an unambiguous range of an empty string.

No, for example (16 .. -40 => ' ') is an empty string, with bounds 16 .. 
-40.

The index range of the empty string denoted by the null string literal 
"" is defined in the RM unambiguously.

> For general case arrays it is ambiguous)

Yes, the index bounds of "(null array)" would have to be specifically 
defined in the RM, similarly to the case for the null string literal.

-- 
Niklas Holsti
Tidorum Ltd
niklas holsti tidorum fi
       .      @       .

  reply	other threads:[~2017-12-23  7:15 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-20 17:28 syntaxic exploration Mehdi Saada
2017-12-20 17:32 ` Mehdi Saada
2017-12-20 20:08   ` Niklas Holsti
2017-12-20 22:18     ` Mehdi Saada
2017-12-20 22:45       ` Mehdi Saada
2017-12-21  7:24         ` Randy Brukardt
2017-12-21  7:44           ` Niklas Holsti
2017-12-21  7:21   ` Randy Brukardt
2017-12-21 16:24     ` Jeffrey R. Carter
2017-12-22  5:01       ` Robert Eachus
2017-12-22 21:15         ` Simon Clubley
2017-12-22 22:11           ` Niklas Holsti
2017-12-22 22:51             ` Dmitry A. Kazakov
2017-12-23  7:15               ` Niklas Holsti [this message]
2017-12-23 16:23             ` Jeffrey R. Carter
2017-12-24  3:37               ` Robert Eachus
2017-12-24 13:39                 ` Niklas Holsti
2017-12-24 13:32               ` Niklas Holsti
2017-12-25 13:40                 ` Jeffrey R. Carter
2017-12-25 14:42                   ` Mehdi Saada
2017-12-25 17:03                     ` Dmitry A. Kazakov
2017-12-25 18:27                     ` Niklas Holsti
2017-12-25 20:12                     ` Jacob Sparre Andersen
2017-12-20 20:05 ` Niklas Holsti
2017-12-20 22:48 ` Mehdi Saada
2017-12-20 23:39   ` Mehdi Saada
2017-12-21  0:35 ` Mehdi Saada
2017-12-21  7:18 ` Randy Brukardt
2017-12-21 19:23   ` G. B.
2017-12-21 23:46   ` bj.mooremr
2017-12-22 23:45     ` Randy Brukardt
2017-12-22 13:31 ` Mehdi Saada
2017-12-22 18:00   ` Mehdi Saada
2017-12-22 18:27   ` Niklas Holsti
2017-12-22 20:25     ` Mehdi Saada
2017-12-22 22:33       ` Niklas Holsti
2017-12-23  1:47 ` Mehdi Saada
2017-12-23  7:17   ` Niklas Holsti
2017-12-23 11:23     ` Mehdi Saada
2017-12-23 11:39       ` Mehdi Saada
2017-12-23 12:09         ` Niklas Holsti
2017-12-23 12:12 ` Mehdi Saada
2017-12-23 12:16   ` Mehdi Saada
2017-12-23 13:04     ` Niklas Holsti
2017-12-23 14:02       ` Mehdi Saada
2017-12-23 14:46         ` Mehdi Saada
2017-12-23 15:03           ` Mehdi Saada
2017-12-23 22:11             ` Niklas Holsti
2017-12-24  0:55               ` Mehdi Saada
replies disabled

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