comp.lang.ada
 help / color / mirror / Atom feed
From: "Jean-Pierre Rosen" <rosen@adalog.fr>
Subject: Re: passing an array to a generic function
Date: Fri, 21 Nov 2003 12:35:16 +0100
Date: 2003-11-21T12:35:16+01:00	[thread overview]
Message-ID: <78tkpb.r04.ln@skymaster> (raw)
In-Reply-To: fc116fae.0311210231.d4a9515@posting.google.com

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


"Mr. J." <ratsonjaniv@hotmail.com> a �crit dans le message news:
fc116fae.0311210231.d4a9515@posting.google.com...
>    type Index is new Integer;
>    type Item is new Character;
>    type Arr is Array(1..23) of character;
>
>    function Filter_String is new Filter_Array(Index,Item,Arr,"=");
>
> As U all experts guessed it won't compile, my question is how to pass
> the array of character to my new function ?
>
In Ada, all types must match *exactly*. Therefore, you must define Arr as:
type Arr is array (Index range 1..23) of Item;

(1..23 has type Integer, not Index. And Item is a type different from
Character).

--
---------------------------------------------------------
           J-P. Rosen (rosen@adalog.fr)
Visit Adalog's web site at http://www.adalog.fr





      parent reply	other threads:[~2003-11-21 11:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-21 10:31 passing an array to a generic function Mr. J.
2003-11-21 11:03 ` Lutz Donnerhacke
2003-11-21 11:20 ` David C. Hoos
2003-11-21 11:35 ` Jean-Pierre Rosen [this message]
replies disabled

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