comp.lang.ada
 help / color / mirror / Atom feed
* Re: A simple ADA puzzle (I haven't the answer)
@ 2004-06-17  8:38 Christoph Karl Walter Grein
  2004-06-23 21:43 ` Randy Brukardt
  0 siblings, 1 reply; 81+ messages in thread
From: Christoph Karl Walter Grein @ 2004-06-17  8:38 UTC (permalink / raw)
  To: comp.lang.ada

From: "Dmitry A.Kazakov" <mailbox@dmitry-kazakov.de>
> As for Ada strings, there are only two problems related:
> 
> 1. The default values for discriminants shall not have any implicit
> effects on the memory allocation policy. That was a mistake of Ada 83.

This syntax was defined exactly for this purpose. So it's _not_ a mistake. You may argue whether that was a clever choice. But there is no other use for the default discriminant than allowing discriminant changes.
An alternative would have been to use a special reserved word. They tried to minimize the number of reserved words and used solutions with special syntax wherever possible.

There are other syntax elements that are not very intuitive either:

   Type_Name'Identifier vs. Type_Name'(Identifier) vs. Type_Name(Identifier)

> 2. Unbounded_String and Bounded_String are nasty patches, which should
> be replaced when Ada will finally have a common supertype for all
> types strings.

This will never by I guess.
____________________________________________________
Aufnehmen, abschicken, nah sein - So einfach ist 
WEB.DE Video-Mail: http://freemail.web.de/?mc=021200




^ permalink raw reply	[flat|nested] 81+ messages in thread
* A simple ADA puzzle (I haven't the answer)
@ 2004-06-16 15:40 Abby
  2004-06-16 16:21 ` Frank J. Lhota
                   ` (2 more replies)
  0 siblings, 3 replies; 81+ messages in thread
From: Abby @ 2004-06-16 15:40 UTC (permalink / raw)


Hi! I have this code:

  type LEN_TYPE is array (INTEGER range <>)
    of CHARACTER;

  type STRING_TYPE (LEN : INTEGER := 0) is
    record
      STRING : LEN_TYPE (1 .. LEN);
    end record;

  type UNC2_ARRAY_TYPE is array (INTEGER range <>)
    of STRING_TYPE;

  type RET2_TYPE (INIT : INTEGER := 0) is
    record
      IFOS : UNC2_ARRAY_TYPE (1 .. INIT);
    end record;

  type RET_TYPE
       ( DEF : INTEGER := 0 )
  is
    record
      ID  : INTEGER;
      IFO : RET2_TYPE (INIT => DEF);
    end record;

  type UNC_ARRAY_TYPE is
    array (INTEGER range <>) of
      RET_TYPE;

and i'd like to initialize and use a variable of type UNC_ARRAY_TYPE (for
the unconstraint array and records choose any value you want, al least 1
:) ). I can say that simply write  VAR : UNC_ARRAY_TYPE (1..3);  gives some
warning but compiles, but gives also a beautiful constraint_error when you
use it, obviously. Any ideas? Thanx for your time!





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

end of thread, other threads:[~2004-07-04 19:06 UTC | newest]

Thread overview: 81+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-06-17  8:38 A simple ADA puzzle (I haven't the answer) Christoph Karl Walter Grein
2004-06-23 21:43 ` Randy Brukardt
  -- strict thread matches above, loose matches on Subject: below --
2004-06-16 15:40 Abby
2004-06-16 16:21 ` Frank J. Lhota
2004-06-16 16:26   ` Abby
2004-06-16 17:01     ` Frank J. Lhota
2004-06-16 17:18       ` Martin Krischik
2004-06-17  6:57         ` Brian May
2004-06-17 12:44         ` Frank J. Lhota
2004-06-16 17:58     ` Jeffrey Carter
2004-06-23 21:14       ` Randy Brukardt
2004-06-16 19:51     ` Simon Wright
2004-06-16 17:56   ` Jeffrey Carter
2004-06-16 22:25     ` Martin Dowie
2004-06-17  0:41       ` Jeffrey Carter
2004-06-17  7:45         ` Martin Dowie
2004-06-17 14:20     ` Frank J. Lhota
2004-06-18 18:07     ` Wojtek Narczynski
2004-06-18 18:37       ` Frank J. Lhota
2004-06-19  2:11         ` Brian May
2004-06-19 11:25         ` Wojtek Narczynski
2004-06-19  1:27       ` Jeffrey Carter
2004-06-19 11:17         ` Wojtek Narczynski
2004-06-16 18:31   ` Hyman Rosen
2004-06-16 20:16     ` Frank J. Lhota
2004-06-16 21:05       ` Hyman Rosen
2004-06-17 13:26         ` Frank J. Lhota
2004-06-17 14:19           ` Hyman Rosen
2004-06-17 15:24             ` Frank J. Lhota
2004-06-23 21:27               ` Randy Brukardt
2004-06-17 19:17           ` Georg Bauhaus
2004-06-16 22:48     ` Alexander E. Kopilovich
2004-06-17 10:25       ` Björn Persson
2004-06-17 14:33         ` Frank J. Lhota
2004-06-17 23:15           ` Alexander E. Kopilovich
2004-06-23 21:30           ` Randy Brukardt
2004-06-17  8:06     ` Dmitry A. Kazakov
2004-06-17 12:19       ` Hyman Rosen
2004-06-17 14:16         ` Dmitry A. Kazakov
2004-06-17 14:17           ` Hyman Rosen
2004-06-17 22:51           ` Brian May
2004-06-18  7:50             ` Dmitry A. Kazakov
2004-06-18 12:32               ` Hyman Rosen
2004-06-18  9:14           ` Ole-Hjalmar Kristensen
2004-06-18 12:24             ` Hyman Rosen
2004-06-18 12:41             ` Dmitry A. Kazakov
2004-06-18 13:16               ` Hyman Rosen
2004-06-18 14:01                 ` Dmitry A. Kazakov
2004-06-18 16:14                   ` Hyman Rosen
2004-06-19  9:31                     ` Dmitry A. Kazakov
2004-06-21  3:30                       ` Hyman Rosen
2004-06-21  8:16                         ` Dmitry A. Kazakov
2004-06-21 16:32                           ` Hyman Rosen
2004-06-22  2:19                             ` David Starner
2004-06-22 13:03                               ` Frank J. Lhota
2004-06-23 21:37                           ` Randy Brukardt
2004-06-24  8:39                             ` Dmitry A. Kazakov
2004-06-24 20:53                               ` Randy Brukardt
2004-06-25  8:24                                 ` Dmitry A. Kazakov
2004-06-25 17:37                                   ` Randy Brukardt
2004-06-26  7:55                                     ` Dmitry A. Kazakov
2004-06-29  0:08                                       ` Randy Brukardt
2004-06-29  9:32                                         ` Dmitry A. Kazakov
2004-06-29 18:36                                           ` Randy Brukardt
2004-06-23 21:21     ` Randy Brukardt
2004-06-24  1:03       ` Jeffrey Carter
2004-06-24 15:19       ` Frank J. Lhota
2004-06-24 16:04         ` Ed Falis
2004-06-24 21:04           ` Randy Brukardt
2004-06-25 15:30             ` Frank J. Lhota
2004-06-25 18:16               ` Bob Spooner
2004-06-25 19:23                 ` Frank J. Lhota
2004-06-26 15:26                   ` Robert I. Eachus
2004-06-28  4:52                     ` Steve
2004-07-04 19:06                       ` Robert I. Eachus
2004-06-29  0:03                 ` Randy Brukardt
2004-06-24 21:00         ` Randy Brukardt
2004-06-16 16:49 ` Martin Krischik
2004-06-17 10:58   ` Björn Persson
2004-06-17  3:48 ` Steve
2004-06-17 10:39   ` Björn Persson

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