comp.lang.ada
 help / color / mirror / Atom feed
From: Jeffrey Carter <spam.jrcarter.not@spam.not.acm.org>
Subject: Re: Beginners question: Compound types, how-to?
Date: Sun, 31 Oct 2010 20:55:14 -0700
Date: 2010-10-31T20:55:14-07:00	[thread overview]
Message-ID: <iale5p$2f6$1@tornado.tornevall.net> (raw)
In-Reply-To: <86wroy58ff.fsf@gareth.avalon.lan>

On 10/31/2010 03:00 PM, Mart van de Wege wrote:
>
> games-rpg-dnd.ads:
> --with Games.RPG;
> -- Ignore parent package for now, we don't need the
> -- utility functions yet.

Children always have visibility into the specs of their ancestors, so you never 
need to "with" said ancestors.

> with Games.RPG.DnD, Ada.Text_IO, Ada.Integer_Text_IO;
> use Games.RPG.DnD, Ada.Text_IO, Ada.Integer_Text_IO;
>
> procedure Test_Game is
>     C : Character;

You have 2 things named Character at this point: Standard.Character, an 
enumeration type, and Standard.Games.RPG.DND.Character, a record type. 
Standard.Character is directly visible, and the other is "use visible", visible 
due to a use clause. The rule is that something that is use visible cannot hide 
something that is directly visible. Since both can't be referenced by the simple 
name Character, this must refer to the one that is directly visible, 
Standard.Character.

Things are different for subprograms, which can be overloaded; then both may be 
visible and referred to by the simple name.

But it's usually a good idea for a beginner to avoid use clauses.

-- 
Jeff Carter
"Why, the Mayflower was full of Fireflies, and a few
horseflies, too. The Fireflies were on the upper deck,
and the horseflies were on the Fireflies."
Duck Soup
95



  parent reply	other threads:[~2010-11-01  3:55 UTC|newest]

Thread overview: 190+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-31 22:00 Beginners question: Compound types, how-to? Mart van de Wege
2010-10-31 22:36 ` Vinzent Hoefler
2010-10-31 23:27   ` Yannick Duchêne (Hibou57)
2010-11-01  7:14     ` Mart van de Wege
2010-11-01 19:22       ` Jeffrey Carter
2010-11-02  9:38     ` J-P. Rosen
2010-11-01  3:55 ` Jeffrey Carter [this message]
2010-11-01  7:12   ` Mart van de Wege
2010-11-01 15:04     ` Shark8
2010-11-01 17:06       ` Mart van de Wege
2010-11-01 17:39         ` Yannick Duchêne (Hibou57)
2010-11-01 17:58           ` Mart van de Wege
2010-11-01 19:19         ` Jeffrey Carter
2010-11-01 19:41           ` Yannick Duchêne (Hibou57)
2010-11-01 20:56             ` Jeffrey Carter
2010-11-01 21:05               ` Yannick Duchêne (Hibou57)
2010-11-03 16:56             ` Warren
2010-11-03 17:01               ` Georg Bauhaus
2010-11-03 17:42                 ` Vinzent Hoefler
2010-11-04  5:23                   ` Stephen Leake
2010-11-04  9:41                     ` Georg Bauhaus
2010-11-06 16:49                       ` Stephen Leake
2010-11-06 18:43                         ` Jeffrey Carter
2010-11-06 19:35                         ` Georg Bauhaus
2010-11-12 20:17                       ` Randy Brukardt
2010-11-12 21:25                         ` Jeffrey Carter
2010-11-04 10:09                     ` Georg Bauhaus
2010-11-06 16:53                       ` Stephen Leake
2010-11-06 19:24                         ` Georg Bauhaus
2010-11-04 17:46                     ` Jeffrey Carter
2010-11-03 20:38                 ` Warren
2010-11-03 20:50                   ` Yannick Duchêne (Hibou57)
2010-11-03 22:32                   ` Georg Bauhaus
2010-11-04 13:59                     ` Warren
2010-11-04 20:57                       ` Martin
2010-11-05 20:43                         ` Warren
2010-11-03 20:44                 ` Yannick Duchêne (Hibou57)
2010-11-03 20:45                   ` Yannick Duchêne (Hibou57)
2010-11-03 21:27                   ` Simon Wright
2010-11-03 22:44                   ` Georg Bauhaus
2010-11-04  1:19                     ` Yannick Duchêne (Hibou57)
2010-11-04  5:18                       ` Shark8
2010-11-04  6:30                         ` Yannick Duchêne (Hibou57)
2010-11-04 14:23                           ` Warren
2010-11-04 10:29                       ` Georg Bauhaus
2010-11-04 11:06                         ` Yannick Duchêne (Hibou57)
2010-11-04 12:56                           ` Georg Bauhaus
2010-11-01 19:59           ` Shark8
2010-11-01 20:43             ` Yannick Duchêne (Hibou57)
2010-11-01 21:54               ` Shark8
2010-11-01 21:01             ` Jeffrey Carter
2010-11-01 21:49               ` Shark8
2010-11-02  0:07           ` Adam Beneschan
2010-11-02  8:17           ` Stephen Leake
2010-11-02  8:29             ` Yannick Duchêne (Hibou57)
2010-11-02  8:50               ` Dmitry A. Kazakov
2010-11-03 12:02               ` Searching for "_Type" discussions Stephen Leake
2010-11-02 19:02             ` Beginners question: Compound types, how-to? Jeffrey Carter
2010-11-02 19:22               ` Yannick Duchêne (Hibou57)
2010-11-02 20:24                 ` Simon Wright
2010-11-03 12:14                   ` _Type vs no _Type Stephen Leake
2010-11-03 21:16                     ` Yannick Duchêne (Hibou57)
2010-11-03 21:19                       ` Yannick Duchêne (Hibou57)
2010-11-04  5:37                         ` Stephen Leake
2010-11-04  5:29                       ` Stephen Leake
2010-11-03 21:29                     ` Simon Wright
2010-11-04  5:28                       ` Nasser M. Abbasi
2010-11-04  6:06                         ` Yannick Duchêne (Hibou57)
2010-11-04  6:40                         ` Shark8
2010-11-05 17:49                           ` Florian Weimer
2010-11-05 18:18                             ` Georg Bauhaus
2010-11-04 18:29                         ` Britt Snodgrass
2010-11-04 19:08                           ` Nasser M. Abbasi
2010-11-04 19:47                             ` Britt Snodgrass
2010-11-04 19:59                             ` Simon Wright
2010-11-04 22:38                               ` Yannick Duchêne (Hibou57)
2010-11-05  7:05                               ` Florian Weimer
2010-11-05  8:48                                 ` Yannick Duchêne (Hibou57)
2010-11-05 16:01                                   ` Dmitry A. Kazakov
2010-11-05 19:26                                     ` Jeffrey Carter
2010-11-05 19:34                                       ` Dmitry A. Kazakov
2010-11-05 19:35                                       ` Florian Weimer
2010-11-05 20:08                                         ` Dmitry A. Kazakov
2010-11-05 20:14                                           ` Florian Weimer
2010-11-05 21:01                                             ` Dmitry A. Kazakov
2010-11-05 20:45                                         ` Warren
2010-11-05 22:59                                           ` Brian Drummond
2010-11-09 20:29                                             ` Warren
2010-11-05 21:37                                         ` Jeffrey Carter
2010-11-05  3:10                             ` Georg Bauhaus
2010-11-05  6:54                             ` J-P. Rosen
2010-11-05 16:39                               ` Robert A Duff
2010-11-05 23:32                                 ` J-P. Rosen
2010-11-06  0:55                                   ` Yannick Duchêne (Hibou57)
2010-11-06 13:40                                     ` Simon Wright
2010-11-05 17:29                             ` Robert A Duff
2010-11-05 19:28                               ` Jeffrey Carter
2010-11-05 23:09                                 ` Robert A Duff
2010-11-06  0:44                                   ` Jeffrey Carter
2010-11-06 21:10                                     ` Robert A Duff
2010-11-07  0:01                                       ` Brian Drummond
2010-11-07 20:41                                       ` Jeffrey Carter
2010-11-07 21:03                                         ` Yannick Duchêne (Hibou57)
2010-11-05  6:49                           ` J-P. Rosen
2010-11-05  7:05                           ` Florian Weimer
2010-11-05  7:20                             ` J-P. Rosen
2010-11-05 17:39                               ` Florian Weimer
2010-11-05 18:08                                 ` Georg Bauhaus
2010-11-05 23:36                                 ` J-P. Rosen
2010-11-06  1:05                                 ` Yannick Duchêne (Hibou57)
2010-11-05 10:58                             ` Georg Bauhaus
2010-11-05 16:31                               ` Dmitry A. Kazakov
2010-11-05 17:38                                 ` Georg Bauhaus
2010-11-05 17:31                               ` Florian Weimer
2010-11-05 18:02                                 ` Georg Bauhaus
2010-11-05 23:29                               ` J-P. Rosen
2010-11-06  0:00                                 ` Robert A Duff
2010-11-06  0:12                                   ` Simon Wright
2010-11-06 11:34                                   ` J-P. Rosen
2010-11-06  0:01                                 ` Georg Bauhaus
2010-11-09 20:43                             ` Warren
2010-11-05 17:24                         ` Robert A Duff
2010-11-05 20:05                           ` Vinzent Hoefler
2010-11-05 22:28                             ` Robert A Duff
2010-11-04 17:40                     ` Jeffrey Carter
2010-11-05 17:15                       ` Robert A Duff
2010-11-05 19:24                         ` Jeffrey Carter
2010-11-05 22:52                           ` Robert A Duff
2010-11-06  0:40                             ` Jeffrey Carter
2010-11-06  7:12                               ` Dmitry A. Kazakov
2010-11-06 10:13                                 ` Yannick Duchêne (Hibou57)
2010-11-06 11:00                                 ` Georg Bauhaus
2010-11-06 11:35                                   ` Dmitry A. Kazakov
2010-11-06 13:34                                     ` Simon Wright
2010-11-06 14:53                                       ` Dmitry A. Kazakov
2010-11-06 20:52                                   ` Shark8
2010-11-06 21:58                                     ` Yannick Duchêne (Hibou57)
2010-11-07  2:57                                       ` Shark8
2010-11-07  3:12                                         ` Yannick Duchêne (Hibou57)
2010-11-07  6:37                                         ` J-P. Rosen
2010-11-06 17:10                                 ` (see below)
2010-11-06 22:08                                   ` Niklas Holsti
2010-11-06 22:24                                     ` Yannick Duchêne (Hibou57)
2010-11-06  0:42                             ` Shark8
2010-11-06 13:24                               ` Robert A Duff
2010-11-06 21:20                                 ` Shark8
2010-11-06 22:12                                   ` Yannick Duchêne (Hibou57)
2010-11-16 20:33                                     ` Randy Brukardt
2010-11-06  1:33                             ` Yannick Duchêne (Hibou57)
2010-11-04 17:49                     ` Jeffrey Carter
2010-11-02 20:38                 ` Beginners question: Compound types, how-to? Jeffrey Carter
2010-11-02 20:59               ` Britt Snodgrass
2010-11-03  0:46                 ` Georg Bauhaus
2010-11-03  1:59                   ` Yannick Duchêne (Hibou57)
2010-11-03 12:59                     ` Georg Bauhaus
2010-11-03 15:28                       ` Georg Bauhaus
2010-11-03  8:58                   ` Dmitry A. Kazakov
2010-11-03 12:31                     ` Georg Bauhaus
2010-11-03 12:18                   ` Stephen Leake
2010-11-03 13:12                     ` Georg Bauhaus
2010-11-04  0:55                     ` Yannick Duchêne (Hibou57)
2010-11-03 17:35                   ` Vinzent Hoefler
2010-11-03 21:19                     ` Simon Wright
2010-11-03 21:31                       ` Vinzent Hoefler
2010-11-04  5:25                         ` Stephen Leake
2010-11-04 17:47                           ` Jeffrey Carter
2010-11-04  6:11                         ` Yannick Duchêne (Hibou57)
2010-11-04 19:30                           ` Vinzent Hoefler
2010-11-04 17:42                         ` Jeffrey Carter
2010-11-03 12:06               ` Stephen Leake
2010-11-04  1:04                 ` Yannick Duchêne (Hibou57)
2010-11-04 17:11                 ` Jeffrey Carter
2010-11-04 13:47               ` Peter C. Chapin
2010-11-04 14:30                 ` Warren
2010-11-01 17:24     ` Yannick Duchêne (Hibou57)
2010-11-01 21:31       ` Simon Wright
2010-11-01 19:05     ` Jeffrey Carter
2010-11-01 11:50   ` (see below)
2010-11-01 17:16     ` Yannick Duchêne (Hibou57)
2010-11-01 17:27       ` Georg Bauhaus
2010-11-01 17:41         ` Yannick Duchêne (Hibou57)
2010-11-01 17:55           ` Yannick Duchêne (Hibou57)
2010-11-01 18:12       ` Adam Beneschan
2010-11-01 19:25     ` Jeffrey Carter
2010-11-01 12:03 ` Brian Drummond
2010-11-01 12:17   ` Florian Weimer
2010-11-01 13:05   ` Mart van de Wege
2010-11-01 22:45     ` Brian Drummond
2010-11-01 23:17       ` Yannick Duchêne (Hibou57)
2010-11-02  8:32         ` Dmitry A. Kazakov
replies disabled

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