comp.lang.ada
 help / color / mirror / Atom feed
From: Mehdi Saada <00120260a@gmail.com>
Subject: Re: strange length check error
Date: Wed, 17 Jan 2018 08:15:45 -0800 (PST)
Date: 2018-01-17T08:15:45-08:00	[thread overview]
Message-ID: <8bd89f13-4ae1-474d-a78d-459fbb8a737c@googlegroups.com> (raw)
In-Reply-To: <6018001a-119d-420f-aac5-d6d463d83778@googlegroups.com>

It's done. I ran the test program, and fortunately, it tells nothing about the core package I spent time on. At least it complies with the specification, though the behavior might be partialy wrong, I'll see that later. But it still shows error with IO child package, which I modified too but contains only:


   function Get_Line (
         File : File_Type := Standard_Input )
     return Bounded_String;

   procedure Put_Line (
         File :        File_Type := Standard_Output;
         Item : in     Bounded_String );

   procedure Put (
         File :        File_Type := Standard_Output;
         Item : in     Bounded_String );

as specs, and as bodies:

   procedure Put (
         File :        File_Type := Standard_Output;
         Item : in     Bounded_String ) is
   begin
      Put(File, Item.Data );
   end Put;

   procedure Put_Line (
         File :        File_Type := Standard_Output;
         Item : in     Bounded_String ) is
   begin
      Put_Line (File, Item.Data );
   end Put_Line;

   function Get_Line (
         File : File_Type := Standard_Input )
     return Bounded_String is
      Ch : Unbounded_String;
   begin
      Ch := Get_Line(File);
      return (Length(Ch), Slice(Ch,1,Length(Ch)));
   end Get_Line;

Originally, there was subprograms with, and without the File parameters. I didn't get why, and put instead default file parameters. I suspect there is a reason I never saw such default parameters in generic package before, but I couldn't help but give a try...

There are the errors:
crea_ora.adb:32:07: no candidate interpretations match the actuals:
crea_ora.adb:32:07: too many arguments in call to "Put_Line"
crea_ora.adb:32:17: expected private type "Ada.Text_Io.File_Type"
crea_ora.adb:32:17: found private type "Bounded_String" defined at p_bounded_g.ads:21, instance at p_bounded_80.ads:6
crea_ora.adb:32:17:   ==> in call to "Put_Line" at p_bounded_g-p_bounded_g_io.ads:17, instance at p_bounded_io_80.ads:9
crea_ora.adb:32:17:   ==> in call to "Put_Line" at a-textio.ads:259

One such piece for each call on Put, Put_Line or Get_Line.


  reply	other threads:[~2018-01-17 16:15 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-16 20:48 strange length check error Mehdi Saada
2018-01-17  1:42 ` Anh Vo
2018-01-17  9:23   ` Simon Wright
2018-01-17 12:13     ` Mehdi Saada
2018-01-17 13:19       ` AdaMagica
2018-01-17 13:41         ` Simon Wright
2018-01-17 21:37           ` Jeffrey R. Carter
2018-01-18 11:12             ` Simon Wright
2018-01-17 13:43         ` Mehdi Saada
2018-01-17 14:03           ` Mehdi Saada
2018-01-17 16:15             ` Mehdi Saada [this message]
2018-01-17 19:43               ` Simon Wright
2018-01-17 21:37                 ` Mehdi Saada
2018-01-17 23:00                   ` Niklas Holsti
2018-01-18 11:07                     ` Simon Wright
2018-01-17 13:15     ` Simon Clubley
2018-01-17  8:49 ` Dmitry A. Kazakov
2018-01-23 16:18 ` Robert Eachus
2018-01-23 16:41   ` Mehdi Saada
2018-01-24 16:22     ` Robert Eachus
replies disabled

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