comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <stephen_leake@stephe-leake.org>
Subject: Re: Function definitions
Date: Sat, 21 Jun 2014 15:56:20 -0500
Date: 2014-06-21T15:56:20-05:00	[thread overview]
Message-ID: <85r42iugln.fsf@stephe-leake.org> (raw)
In-Reply-To: 49b56788-d1a4-4304-9e0c-b12336a7512c@googlegroups.com

Adam Beneschan <adambeneschan@gmail.com> writes:

> First of all, if you want the bounds of Individual to be flexible,
> you'll need to make Individual a discriminant record:
>
>
>     type Individual (P, Q, R : Natural) is record 
>        X : x_array (0..P); 
>        Y : y_array (0..Q); 
>        Z : z_array (0..R); 
>     end record; 

or make Search generic:

generic
    P,Q,R : Natural; 
package Search is

    ...
    type Individual is record 
       X : x_array (0..P); 
       Y : y_array (0..Q); 
       Z : z_array (0..R); 
    end record; 

    ...
end Search;

Then you have to instantiate Search in main_search.adb.

Which is better depends on many other things, in the full application.

-- 
-- Stephe

  parent reply	other threads:[~2014-06-21 20:56 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-20 15:18 Function definitions montgrimpulo
2014-06-20 15:44 ` Adam Beneschan
2014-06-20 16:22 ` montgrimpulo
2014-06-20 16:43   ` Adam Beneschan
2014-06-20 16:52     ` Simon Clubley
2014-06-20 17:05       ` Adam Beneschan
2014-06-20 16:43   ` Simon Clubley
2014-06-22  6:59   ` Shark8
2014-06-20 17:39 ` montgrimpulo
2014-06-20 18:19   ` Adam Beneschan
2014-06-20 18:20     ` Adam Beneschan
2014-06-21 20:56     ` Stephen Leake [this message]
2014-06-22 12:27     ` Simon Clubley
2014-06-20 20:39   ` Robert A Duff
2014-06-21 12:27 ` montgrimpulo
2014-06-21 12:38   ` Simon Clubley
2014-06-21 17:57   ` Jeffrey Carter
2014-06-21 13:40 ` montgrimpulo
replies disabled

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