comp.lang.ada
 help / color / mirror / Atom feed
From: Kevin Chadwick <kevc3no4@gmail.com>
Subject: Empty String confusion; Positive and Natural
Date: Mon, 29 Nov 2021 09:34:47 -0800 (PST)	[thread overview]
Message-ID: <053c8a45-2829-4f2e-925c-b72308c1fe61n@googlegroups.com> (raw)

I suspect that I am doing something outside of Ada norms.

Are empty strings avoided in Ada?

I have a function to create a record containing strings amongst other things like a subtyped integer, simply to group the outputs neatly of another function.

If something goes wrong and I run the create function with "" then the strings length is zero. Why is a string type Positive and not Natural, because empty strings are in fact useless?

I guess I shall consider re-engineering my functions, rather than add checks, but all thoughts are welcome.

             reply	other threads:[~2021-11-29 17:34 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-29 17:34 Kevin Chadwick [this message]
2021-11-29 18:05 ` Empty String confusion; Positive and Natural Jeffrey R.Carter
2021-11-29 19:19 ` Niklas Holsti
2021-11-29 22:50   ` Kevin Chadwick
2021-11-30  8:29     ` Simon Wright
2021-11-30  8:34     ` Niklas Holsti
2021-11-30 10:00     ` Jeffrey R.Carter
2021-11-30 12:17       ` Kevin Chadwick
2021-11-30 12:54         ` J-P. Rosen
2021-11-30 13:12           ` Kevin Chadwick
2021-11-30  7:40 ` ldries46
2021-11-30  8:21   ` Simon Wright
2021-11-30 12:39     ` ldries46
replies disabled

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