comp.lang.ada
 help / color / mirror / Atom feed
* Question about constants initialisation
@ 1996-04-24  0:00 Pascal Obry
  1996-04-24  0:00 ` Samuel Tardieu
  0 siblings, 1 reply; 3+ messages in thread
From: Pascal Obry @ 1996-04-24  0:00 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1515 bytes --]


I was wondering how to initialize the constant Null_Azerty in the
following piece of code :

-------------------------------------
with Ada.Strings.Unbounded;

package Ess is

   use Ada.Strings.Unbounded;

   type Azerty is private;

   Null_Azerty : constant Azerty;

private

   type Azerty is new Unbounded_String;

   Null_Azerty : constant Azerty := ... ;

   --  I tried this with GNAT and it doesn't works ?
   --  Is it a bug ?
   --Null_Azerty : constant Azerty := Azerty (To_Unbounded_String
(""));

   --NA : Unbounded_String := Null_Unbounded_String;
   --Null_Azerty : constant Azerty := NA;

end Ess;
-----------------------------------

If it's a GNAT bug let me know and I'll report it.

Thanks for your help,
Pascal.


--|------------------------------------------------------------
--| Pascal Obry                               Team-Ada Member |
--|                                                           |
--| EDF-DER-IPN-SID- Ing�nierie des Syst�mes d'Informations   |
--|                                                           |
--| Bureau G1-010           e-mail: pascal.obry@der.edfgdf.fr |
--| 1 Av G�n�ral de Gaulle  voice : +33-1-47.65.50.91         |
--| 92141 Clamart CEDEX     fax   : +33-1-47.65.50.07         |
--| FRANCE                                                    |
--|------------------------------------------------------------
--|
--|   http://ourworld.compuserve.com/homepages/pascal_obry
--|
--|   "The best way to travel is by means of imagination"





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

* Re: Question about constants initialisation
  1996-04-24  0:00 Question about constants initialisation Pascal Obry
@ 1996-04-24  0:00 ` Samuel Tardieu
  1996-04-25  0:00   ` Pascal Obry
  0 siblings, 1 reply; 3+ messages in thread
From: Samuel Tardieu @ 1996-04-24  0:00 UTC (permalink / raw)
  To: Pascal Obry

>>>>> "Pascal" == Pascal Obry <pascal.obry@der.edfgdf.fr> writes:

Pascal> I was wondering how to initialize the constant Null_Azerty in
Pascal> the following piece of code.

The following piece of code:

with Ada.Strings.Unbounded;
package Ess is
   use Ada.Strings.Unbounded;
   type Azerty is private;
   Null_Azerty : constant Azerty;
private
   type Azerty is new Unbounded_String;
   Null_Azerty : constant Azerty := Azerty (Null_Unbounded_String);
end Ess;

works well with GNAT 3.03:

% gcc -c -gnatv ess.ads

GNAT Compiler Version 3.03 Copyright 1995 Free Software Foundation, Inc.

Compiling: ess.ads (source file time stamp: 1996-04-24 15:23:29)
 9 lines: No errors

   Sam
-- 
"La cervelle des petits enfants, ca doit avoir comme un petit gout de noisette"
                                                       Charles Baudelaire




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

* Re: Question about constants initialisation
  1996-04-24  0:00 ` Samuel Tardieu
@ 1996-04-25  0:00   ` Pascal Obry
  0 siblings, 0 replies; 3+ messages in thread
From: Pascal Obry @ 1996-04-25  0:00 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1773 bytes --]

Samuel Tardieu <sam@inf.enst.fr> wrote:

>>>>>> "Pascal" == Pascal Obry <pascal.obry@der.edfgdf.fr> writes:

>Pascal> I was wondering how to initialize the constant Null_Azerty in
>Pascal> the following piece of code.

>The following piece of code:

>with Ada.Strings.Unbounded;
>package Ess is
>   use Ada.Strings.Unbounded;
>   type Azerty is private;
>   Null_Azerty : constant Azerty;
>private
>   type Azerty is new Unbounded_String;
>   Null_Azerty : constant Azerty := Azerty (Null_Unbounded_String);
>end Ess;

>works well with GNAT 3.03:

>% gcc -c -gnatv ess.ads

>GNAT Compiler Version 3.03 Copyright 1995 Free Software Foundation, Inc.

>Compiling: ess.ads (source file time stamp: 1996-04-24 15:23:29)
> 9 lines: No errors

>   Sam
>-- 
>"La cervelle des petits enfants, ca doit avoir comme un petit gout de noisette"
>                                                       Charles Baudelaire

Thanks, So this is a bug under GNAT 3.01 the current version under
Windows NT.

Pascal.

--|------------------------------------------------------------
--| Pascal Obry                               Team-Ada Member |
--|                                                           |
--| EDF-DER-IPN-SID- Ing�nierie des Syst�mes d'Informations   |
--|                                                           |
--| Bureau G1-010           e-mail: pascal.obry@der.edfgdf.fr |
--| 1 Av G�n�ral de Gaulle  voice : +33-1-47.65.50.91         |
--| 92141 Clamart CEDEX     fax   : +33-1-47.65.50.07         |
--| FRANCE                                                    |
--|------------------------------------------------------------
--|
--|   http://ourworld.compuserve.com/homepages/pascal_obry
--|
--|   "The best way to travel is by means of imagination"





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

end of thread, other threads:[~1996-04-25  0:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-04-24  0:00 Question about constants initialisation Pascal Obry
1996-04-24  0:00 ` Samuel Tardieu
1996-04-25  0:00   ` Pascal Obry

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