comp.lang.ada
 help / color / mirror / Atom feed
* Null unbounded string
@ 2014-08-09 15:28 Victor Porton
  2014-08-09 15:36 ` mockturtle
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Victor Porton @ 2014-08-09 15:28 UTC (permalink / raw)


Is Ada.Strings.Unbounded.Null_Unbounded_String an empty string or is it 
something different (like NULL char pointer in C)?

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

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

* Re: Null unbounded string
  2014-08-09 15:28 Null unbounded string Victor Porton
@ 2014-08-09 15:36 ` mockturtle
  2014-08-09 15:38 ` Jeffrey Carter
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 11+ messages in thread
From: mockturtle @ 2014-08-09 15:36 UTC (permalink / raw)


On Saturday, August 9, 2014 5:28:49 PM UTC+2, Victor Porton wrote:
> Is Ada.Strings.Unbounded.Null_Unbounded_String an empty string or is it 
> something different (like NULL char pointer in C)?
> 

I'm not a language lawyer, but I would say that from a "conceptual" point of view is a string (e.g., you can concatenate it with other strings).  How the null string is actually implemented, I think, it is a "private" matter of the implementation that could decide to represent it as a NULL pointer.  Maybe a LL can elaborate more on this.


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

* Re: Null unbounded string
  2014-08-09 15:28 Null unbounded string Victor Porton
  2014-08-09 15:36 ` mockturtle
@ 2014-08-09 15:38 ` Jeffrey Carter
  2014-08-09 15:57   ` Victor Porton
  2014-08-09 19:06 ` Per Sandberg
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 11+ messages in thread
From: Jeffrey Carter @ 2014-08-09 15:38 UTC (permalink / raw)


On 08/09/2014 08:28 AM, Victor Porton wrote:
> Is Ada.Strings.Unbounded.Null_Unbounded_String an empty string or is it
> something different (like NULL char pointer in C)?

It's equivalent to an empty string. How it's implemented is unimportant.

-- 
Jeff Carter
"Insufficient laughter--that's grounds for divorce."
Play It Again, Sam
126


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

* Re: Null unbounded string
  2014-08-09 15:38 ` Jeffrey Carter
@ 2014-08-09 15:57   ` Victor Porton
  2014-08-09 18:26     ` Simon Wright
  0 siblings, 1 reply; 11+ messages in thread
From: Victor Porton @ 2014-08-09 15:57 UTC (permalink / raw)


Jeffrey Carter wrote:

> On 08/09/2014 08:28 AM, Victor Porton wrote:
>> Is Ada.Strings.Unbounded.Null_Unbounded_String an empty string or is it
>> something different (like NULL char pointer in C)?
> 
> It's equivalent to an empty string. How it's implemented is unimportant.

But where in the ARM it's said that it is equivalent to an empty string?

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


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

* Re: Null unbounded string
  2014-08-09 15:57   ` Victor Porton
@ 2014-08-09 18:26     ` Simon Wright
  2014-08-09 18:53       ` Victor Porton
  0 siblings, 1 reply; 11+ messages in thread
From: Simon Wright @ 2014-08-09 18:26 UTC (permalink / raw)


Victor Porton <porton@narod.ru> writes:

> Jeffrey Carter wrote:
>
>> On 08/09/2014 08:28 AM, Victor Porton wrote:
>>> Is Ada.Strings.Unbounded.Null_Unbounded_String an empty string or is it
>>> something different (like NULL char pointer in C)?
>> 
>> It's equivalent to an empty string. How it's implemented is unimportant.
>
> But where in the ARM it's said that it is equivalent to an empty string?

http://www.ada-auth.org/standards/12rm/html/RM-A-4-5.html#p73

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

* Re: Null unbounded string
  2014-08-09 18:26     ` Simon Wright
@ 2014-08-09 18:53       ` Victor Porton
  2014-08-09 20:58         ` Niklas Holsti
  0 siblings, 1 reply; 11+ messages in thread
From: Victor Porton @ 2014-08-09 18:53 UTC (permalink / raw)


Simon Wright wrote:

> Victor Porton <porton@narod.ru> writes:
> 
>> Jeffrey Carter wrote:
>>
>>> On 08/09/2014 08:28 AM, Victor Porton wrote:
>>>> Is Ada.Strings.Unbounded.Null_Unbounded_String an empty string or is it
>>>> something different (like NULL char pointer in C)?
>>> 
>>> It's equivalent to an empty string. How it's implemented is unimportant.
>>
>> But where in the ARM it's said that it is equivalent to an empty string?
> 
> http://www.ada-auth.org/standards/12rm/html/RM-A-4-5.html#p73

It does NOT say that null string is empty string.

Should we make a formal clarification request?

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

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

* Re: Null unbounded string
  2014-08-09 15:28 Null unbounded string Victor Porton
  2014-08-09 15:36 ` mockturtle
  2014-08-09 15:38 ` Jeffrey Carter
@ 2014-08-09 19:06 ` Per Sandberg
  2014-08-11 10:55 ` AdaMagica
  2014-08-12  0:30 ` anon
  4 siblings, 0 replies; 11+ messages in thread
From: Per Sandberg @ 2014-08-09 19:06 UTC (permalink / raw)


This is a string with "" content and you shall not reflect on the 
implementation, since this is "implementation dependent".


On 09.08.2014 17:28, Victor Porton wrote:
> Is Ada.Strings.Unbounded.Null_Unbounded_String an empty string or is it
> something different (like NULL char pointer in C)?
>

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

* Re: Null unbounded string
  2014-08-09 18:53       ` Victor Porton
@ 2014-08-09 20:58         ` Niklas Holsti
  2014-08-11 15:29           ` Adam Beneschan
  0 siblings, 1 reply; 11+ messages in thread
From: Niklas Holsti @ 2014-08-09 20:58 UTC (permalink / raw)


On 14-08-09 21:53 , Victor Porton wrote:
> Simon Wright wrote:
> 
>> Victor Porton <porton@narod.ru> writes:
>>
>>> Jeffrey Carter wrote:
>>>
>>>> On 08/09/2014 08:28 AM, Victor Porton wrote:
>>>>> Is Ada.Strings.Unbounded.Null_Unbounded_String an empty string or is it
>>>>> something different (like NULL char pointer in C)?
>>>>
>>>> It's equivalent to an empty string. How it's implemented is unimportant.
>>>
>>> But where in the ARM it's said that it is equivalent to an empty string?
>>
>> http://www.ada-auth.org/standards/12rm/html/RM-A-4-5.html#p73
> 
> It does NOT say that null string is empty string.

It says that Null_Unbounded_String represents the "null String", which
is RM-ese for a String with no elements, an empty String.

See http://www.ada-auth.org/standards/12rm/html/RM-3-6-1.html#p7 for the
definition of a "null array", and remember that String is an array type.

> Should we make a formal clarification request?

No need.

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

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

* Re: Null unbounded string
  2014-08-09 15:28 Null unbounded string Victor Porton
                   ` (2 preceding siblings ...)
  2014-08-09 19:06 ` Per Sandberg
@ 2014-08-11 10:55 ` AdaMagica
  2014-08-12  0:30 ` anon
  4 siblings, 0 replies; 11+ messages in thread
From: AdaMagica @ 2014-08-11 10:55 UTC (permalink / raw)


Use the top secret RM Index and you'll find 2.6(6).

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

* Re: Null unbounded string
  2014-08-09 20:58         ` Niklas Holsti
@ 2014-08-11 15:29           ` Adam Beneschan
  0 siblings, 0 replies; 11+ messages in thread
From: Adam Beneschan @ 2014-08-11 15:29 UTC (permalink / raw)


On Saturday, August 9, 2014 1:58:10 PM UTC-7, Niklas Holsti wrote:

> > Should we make a formal clarification request?
> 
> No need.

Given that the terms are defined if you know where to look, I guess you're right that there's no *need*.  However, using the word "null" for multiple purposes (including a null access value) can be confusing, and obviously it's confused at least one person and has probably caused some confusion for others too.  So it can't hurt to suggest maybe adding a short parenthesized clarification such as "(a string with length 0)".

                                -- Adam


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

* Re: Null unbounded string
  2014-08-09 15:28 Null unbounded string Victor Porton
                   ` (3 preceding siblings ...)
  2014-08-11 10:55 ` AdaMagica
@ 2014-08-12  0:30 ` anon
  4 siblings, 0 replies; 11+ messages in thread
From: anon @ 2014-08-12  0:30 UTC (permalink / raw)


RM states it is a Null String

  Null_String : aliased String := "" ;

In <ls5enf$49s$1@speranza.aioe.org>, Victor Porton <porton@narod.ru> writes:
>Is Ada.Strings.Unbounded.Null_Unbounded_String an empty string or is it 
>something different (like NULL char pointer in C)?
>
>-- 
>Victor Porton - http://portonvictor.org

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

end of thread, other threads:[~2014-08-12  0:30 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-09 15:28 Null unbounded string Victor Porton
2014-08-09 15:36 ` mockturtle
2014-08-09 15:38 ` Jeffrey Carter
2014-08-09 15:57   ` Victor Porton
2014-08-09 18:26     ` Simon Wright
2014-08-09 18:53       ` Victor Porton
2014-08-09 20:58         ` Niklas Holsti
2014-08-11 15:29           ` Adam Beneschan
2014-08-09 19:06 ` Per Sandberg
2014-08-11 10:55 ` AdaMagica
2014-08-12  0:30 ` anon

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