comp.lang.ada
 help / color / mirror / Atom feed
* Problem when overloading a procedure
@ 1999-08-14  0:00 JIMHER@yanoesladirecci�n.com
  1999-08-14  0:00 ` David C. Hoos, Sr.
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: JIMHER@yanoesladirecci�n.com @ 1999-08-14  0:00 UTC (permalink / raw)


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

I'm writing a program, and I have found a problem when I try to overload 
a procedure. The program is:

procedure program is

   type MyType is array(1..10) of character;
   
   procedure proc(s:in string) is
   begin
      put_line("Original string");
   end proc;
   
   procedure proc(s:in MyType) is
   begin
      put_line("My type");
   end proc;

begin
   proc("hello");   
end program;

The problem is that, when I compile the program, the compiler says that 
is unable to select between the two forms of 'proc'. I suppose that it is 
because the compiler can't decide if the literal "hello" is of type 
string or MyType, so I tried 

...
begin
   proc(string("hello"));
end program;

but the compiler didn't accept it.

I think that it will be some language way to tell the compiler if the 
literal sent to 'proc' is of type string or of type MyType, so I would 
thank a lot if any one could tell me how. Also, if it can be done by 
another way, it could help me too.

Thanks in advance and sorry about my english

-- 
Jes�s Jim�nez Herranz
vtis0102@CACANOps.uib.es
(Remove CACANO from the address)




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

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

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-08-14  0:00 Problem when overloading a procedure JIMHER@yanoesladirecci�n.com
1999-08-14  0:00 ` David C. Hoos, Sr.
1999-08-16  0:00 ` Robert Dewar
1999-08-17  0:00 ` Samuel T. Harris
1999-08-18  0:00   ` JIMHER@yanoesladirecci�n.com

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