comp.lang.ada
 help / color / mirror / Atom feed
* Empty String confusion; Positive and Natural
@ 2021-11-29 17:34 Kevin Chadwick
  2021-11-29 18:05 ` Jeffrey R.Carter
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Kevin Chadwick @ 2021-11-29 17:34 UTC (permalink / 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.

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2021-11-30 13:12 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-29 17:34 Empty String confusion; Positive and Natural Kevin Chadwick
2021-11-29 18:05 ` 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

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