* Problem...
@ 1998-01-20 0:00 Scott Barrish
1998-01-20 0:00 ` Problem John English
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Scott Barrish @ 1998-01-20 0:00 UTC (permalink / raw)
I have this package and I can't seem to figure out why I am getting thiserror
message in my source code file.
Package Static_Sort is a s follows:
generic
type Element_Type is private;
with function "<"(Left, Right : in Element_Type) return boolean;
package Static_Sort is
type Sort_Type (Max_Size : Positive) is limited private;
procedure Select_Sort(List : in out Sort_Type);
private
type Sort_Array is array (positive range <>) of Element_Type;
type Sort_Type (Max_Size : positive) is
record
Length : natural := 0;
Info : Sort_Array(1..Max_Size);
end record;
end Static_Sort;
The source code file is as follows:
with Ada.Text_IO; use Ada.Text_IO;
with Ada.Integer_Text_IO; use Ada.Integer_Text_IO;
with Static_Sort;
procedure main is
package Int_Sort_IO is new Static_Sort(Element_Type => integer);
Int_Sort : Int_Sort_IO.Sort_Type(10);
begin
Put_Line("Let's give it a try.");
Int_Sort_IO.Select_Sort(Int_Sort); //This is the line the compiler gies the
error.
end main;
Error messageis as follows:
151-8.ada: Error: line 7 col 64 LRM:12.3(10), Missing actual parameter for <,
Continuing
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Problem...
1998-01-20 0:00 Problem Scott Barrish
@ 1998-01-20 0:00 ` John English
1998-01-20 0:00 ` Problem Sven Derben
1998-01-20 0:00 ` Problem Stephen Leake
2 siblings, 0 replies; 5+ messages in thread
From: John English @ 1998-01-20 0:00 UTC (permalink / raw)
Scott Barrish (TeufelHunde@worldnet.att.net) wrote:
: I have this package and I can't seem to figure out why I am getting thiserror
: message in my source code file.
: with function "<"(Left, Right : in Element_Type) return boolean;
What happens if you change this line to:
with function "<"(Left, Right : in Element_Type) return boolean is <>;
??
-----------------------------------------------------------------
John English | mailto:je@brighton.ac.uk
Senior Lecturer | http://www.it.bton.ac.uk/staff/je
Dept. of Computing | ** NON-PROFIT CD FOR CS STUDENTS **
University of Brighton | -- see http://burks.bton.ac.uk
-----------------------------------------------------------------
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Problem...
1998-01-20 0:00 Problem Scott Barrish
1998-01-20 0:00 ` Problem John English
@ 1998-01-20 0:00 ` Sven Derben
1998-01-20 0:00 ` Problem Stephen Leake
2 siblings, 0 replies; 5+ messages in thread
From: Sven Derben @ 1998-01-20 0:00 UTC (permalink / raw)
On 20 Jan 1998 07:27:04 GMT, "Scott Barrish" <TeufelHunde@worldnet.att.net> wrote:
>I have this package and I can't seem to figure out why I am getting thiserror
>message in my source code file.
>
>Package Static_Sort is a s follows:
>
>generic
> type Element_Type is private;
> with function "<"(Left, Right : in Element_Type) return boolean;
>
Write
with function "<"(Left, Right : in Element_Type ) return boolean is <>;
See section 12.6 from the RM.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Problem...
1998-01-20 0:00 Problem Scott Barrish
1998-01-20 0:00 ` Problem John English
1998-01-20 0:00 ` Problem Sven Derben
@ 1998-01-20 0:00 ` Stephen Leake
1998-01-20 0:00 ` Problem Robert Dewar
2 siblings, 1 reply; 5+ messages in thread
From: Stephen Leake @ 1998-01-20 0:00 UTC (permalink / raw)
Scott Barrish wrote:
>
> I have this package and I can't seem to figure out why I am getting thiserror
> message in my source code file.
> <snip>
>
> with Ada.Text_IO; use Ada.Text_IO;
> with Ada.Integer_Text_IO; use Ada.Integer_Text_IO;
> with Static_Sort;
>
> procedure main is
>
> package Int_Sort_IO is new Static_Sort(Element_Type => integer);
>
> Int_Sort : Int_Sort_IO.Sort_Type(10);
>
> begin
>
> Put_Line("Let's give it a try.");
> Int_Sort_IO.Select_Sort(Int_Sort); //This is the line the compiler gies the
> error.
>
> end main;
>
> Error messageis as follows:
>
> 151-8.ada: Error: line 7 col 64 LRM:12.3(10), Missing actual parameter for <,
> Continuing
Um, counting seven lines from the top, the error is on the instantiation
of the package:
> package Int_Sort_IO is new Static_Sort(Element_Type => integer);
not on the line you indicate. The instantiation requires a "<" function,
as the error message says.
I'd say you need a better editor, that puts the cursor on the error!
Emacs does this; I assume AdaGIDE (comes with GNAT on Win95) does, but
I'm not sure.
--
- Stephe
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Problem...
1998-01-20 0:00 ` Problem Stephen Leake
@ 1998-01-20 0:00 ` Robert Dewar
0 siblings, 0 replies; 5+ messages in thread
From: Robert Dewar @ 1998-01-20 0:00 UTC (permalink / raw)
Stephe says
<<I'd say you need a better editor, that puts the cursor on the error!
Emacs does this; I assume AdaGIDE (comes with GNAT on Win95) does, but
I'm not sure.
>>
GNAT goes to a lot of trouble to place error flags at just the right
column when it can. If you are new to the language, I would suggest
using the switch -gnatv when compiling GNAT, that way (assuming you
are working just with ASCII input and output, and not with a fancy
IDE/editor etc, you get error messages that clearly show where
they are pointing to.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~1998-01-20 0:00 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-01-20 0:00 Problem Scott Barrish
1998-01-20 0:00 ` Problem John English
1998-01-20 0:00 ` Problem Sven Derben
1998-01-20 0:00 ` Problem Stephen Leake
1998-01-20 0:00 ` Problem Robert Dewar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox