comp.lang.ada
 help / color / mirror / Atom feed
From: Veronique GAILDRAT <gaildrat@irit.fr>
Subject: pb with child units
Date: Fri, 23 Feb 2001 15:06:05 +0100
Date: 2001-02-23T14:06:05+00:00	[thread overview]
Message-ID: <3A966E4D.778BE01E@irit.fr> (raw)

Hello,

I try to call a subprogram from a brother unit :

specification of the parent unit :
---------------------------------
generic
  type Item is private;
  with function image (t : Item) return String;
  with function equals (i1, i2 : Item) return boolean;

package liste_dyn_gen_p is
	type Liste is limited private; 
	LISTE_VIDE, LISTE_PLEINE, ERREUR_INDEX : exception;

	-- d�clarations des op�rations export�es par le TDA
	function toString (le : Liste) return String;
........
	private
		type Cellule;
		type Liste is access Cellule;
		type Cellule is record
			value : Item;
			nextV : Liste;
		end record;
end liste_dyn_gen_p;

specification of the called unit :
---------------------------------
generic
package liste_dyn_gen_p.liste_simple_p is
	procedure insererEnTete (le : in out Liste; i : Item);
....
end liste_dyn_gen_p.liste_simple_p;

call :
------
specification :
---------------
generic
	with function "<"(i1, i2 : Item) return Boolean;
package liste_dyn_gen_p.liste_dyn_triee_p is
	procedure inserer (le : in out Liste; e : Item);
end liste_dyn_gen_p.liste_dyn_triee_p;

body :
------
with liste_dyn_gen_p.liste_simple_p;

package body liste_dyn_gen_p.liste_dyn_triee_p is
	procedure inserer (le : in out Liste; e : Item) is
		pt : Liste := le;
		pTmp : Liste;
	begin
		if estVide(le) or else  e < premier(le) then 
----> error ---->	liste_dyn_gen_p.liste_simple_p.insererEnTete(le, e);
		else
......
		end if;
	end inserer;
end liste_dyn_gen_p.liste_dyn_triee_p;

The compiling error is the next one : 
	invalid prefix in selected component "liste_simple_p"

but liste_simple_p is a child unit of liste_dyn_gen_p !
They are both generic, but a can use them in a child unit ??

An idea ??

Thanks

-- 
------------------------
Veronique Gaildrat
IRIT-UPS
email : gaildrat@irit.fr
------------------------



             reply	other threads:[~2001-02-23 14:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-02-23 14:06 Veronique GAILDRAT [this message]
2001-02-23 14:43 ` pb with child units Ted Dennison
replies disabled

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