comp.lang.ada
 help / color / mirror / Atom feed
From: "Matthew Heaney" <matthew_heaney@acm.org>
Subject: Re: Help needed: Access type to functions in generic package
Date: 1999/09/12
Date: 1999-09-12T00:00:00+00:00	[thread overview]
Message-ID: <37dc1a3f@news1.prserv.net> (raw)
In-Reply-To: 37DBFEBF.B74D1958@deathsdoor.com

In article <37DBFEBF.B74D1958@deathsdoor.com> , Zeiram 
<zeiram@deathsdoor.com>  wrote:

>> Why is this package generic?  Why don't you declare your array type this
>> way:
>>
>
> In fact, this was just a part of the definitions of my package.
> In reality, my type T_Maze is declared as private.

Then why not declare T_Maze as private, but with discriminants?

  package Maze is

    type T_Maze (X, Y, Z : Positive) is private;

  private

    type T_Maze_Array is
      array (Positive range <>, Positive range <>, Positive range <>) of
      T_Cell;

    type T_Maze (X, Y, Z : Positive) is
      record
        Items : T_Maze_Array (1 .. X, 1 .. Y, 1 .. Z);
      end record;

  end Maze;



> This is due
> to the fact that I also need to realize a dynamic implementation
> of my software (yes, this a project from my CS course :-) )

I don't know what you mean by "realize a dynamic implementation."

> It consequently seemed logical to create this package as a
> generic one.

I'm still not convinced you need a generic.


> If I decide to use a non private type and do only a static
> implementation, I know for sure your solution will work
> perfect. (It was, in fact, the way I ran my first tests)

I don't know what you mean by "static implementation."

Does the private type above meet your needs?  If not, why not?




  reply	other threads:[~1999-09-12  0:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-09-12  0:00 Help needed: Access type to functions in generic package Zeiram
1999-09-12  0:00 ` Matthew Heaney
1999-09-12  0:00   ` Zeiram
1999-09-12  0:00     ` Matthew Heaney [this message]
1999-09-13  0:00       ` zeiram
1999-09-13  0:00         ` Matthew Heaney
replies disabled

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