comp.lang.ada
 help / color / mirror / Atom feed
* Redefining Integer Type ...
@ 2000-10-18  0:00 Arnaud de Muyser
  2000-10-18  0:00 ` Robert A Duff
  0 siblings, 1 reply; 5+ messages in thread
From: Arnaud de Muyser @ 2000-10-18  0:00 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 376 bytes --]


 Hi,

I've a little question about operator "+" resolution into 
the following pack2-proc.adb procedure.
Why the resolved type (by gnat) is standard.integer whereas
the visible type named Integer is pack.integer (using use clause).
The type cast Integer(var) isn't enough ?

I given you the complete source to investigate what appened.

Thanks for the help.

Arnaud de Muyser

[-- Attachment #2: pack.ads --]
[-- Type: text/plain, Size: 87 bytes --]

Package Pack is

  Type Integer is range 1..1000 ;

  current : Integer := 1 ;


End ;

[-- Attachment #3: pack2-proc.adb --]
[-- Type: text/plain, Size: 137 bytes --]


separate( pack2 )
Procedure Proc is
Begin
   for i in 1..10 
   loop
        tab( i + 30*Integer( current)  ) := 1; 
   end loop;
End ;

[-- Attachment #4: pack2.adb --]
[-- Type: text/plain, Size: 131 bytes --]

with Pack; use Pack;

Package Body Pack2 is

  tab : array( 1..Integer(1000) ) of Integer ;

  Procedure proc is separate ;

End ;

[-- Attachment #5: pack2.ads --]
[-- Type: text/plain, Size: 46 bytes --]


Package Pack2 is

  Procedure Proc;

End ;  

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2000-10-18  0:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-10-18  0:00 Redefining Integer Type Arnaud de Muyser
2000-10-18  0:00 ` Robert A Duff
2000-10-18  0:00   ` Gautier
2000-10-18  0:00   ` Pat Rogers
2000-10-18  0:00     ` Robert A Duff

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