comp.lang.ada
 help / color / mirror / Atom feed
From: Victor Porton <porton@narod.ru>
Subject: Re: Ada.Strings.Unbounded vs Ada.Containers.Indefinite_Holders
Date: Fri, 22 Sep 2017 15:16:54 +0300
Date: 2017-09-22T15:16:54+03:00	[thread overview]
Message-ID: <oq2uvm$h5k$1@gioia.aioe.org> (raw)
In-Reply-To: d489d42e-a8f1-466f-88f4-0d18765e27dc@googlegroups.com

AdaMagica wrote:

> Am Donnerstag, 21. September 2017 20:14:29 UTC+2 schrieb Victor Porton:
>> This may be a little slower.
> 
> Why do you care for performance? Have you ever measured what you are
> worrying about?
> 
> Premature optimization is the source of all evil - you can hear this
> mantra very often here.
> 
> 
>> Hm well, do I understand Null_Unbounded_String correctly? Is
>> Null_Unbounded_String really "no string"? or is it just empty string
>> ("")?
> 
> It's the latter. Is RM A.4.5(73) and 2.5(6) clear enough?

The problem I asked about is exactly that A.4.5(73) is not clear enough. 
What is 2.5(6)? There is no (6) in RM 2.5.

Well, you are right (assuming that GCC 7.2.0 does the right thing), as this 
prints "True":

with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
with Ada.Text_IO;

procedure Test is
begin
  Ada.Text_IO.Put_Line(Boolean'Image(To_Unbounded_String("") = 
Null_Unbounded_String));
end;


-- 
Victor Porton - http://portonvictor.org

  reply	other threads:[~2017-09-22 12:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-21 18:14 Ada.Strings.Unbounded vs Ada.Containers.Indefinite_Holders Victor Porton
2017-09-21 21:30 ` AdaMagica
2017-09-22 12:16   ` Victor Porton [this message]
2017-09-22 19:25     ` Simon Wright
2017-09-22 22:15       ` Victor Porton
2017-09-23  8:09         ` Dmitry A. Kazakov
2017-09-23  9:16           ` Jeffrey R. Carter
2017-10-03  0:15             ` Randy Brukardt
replies disabled

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