comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Ok - WHAT are those "Maps.Identity" things ???
Date: Thu, 6 Jan 2022 22:14:06 -0600	[thread overview]
Message-ID: <sr8emg$u51$1@franka.jacob-sparre.dk> (raw)
In-Reply-To: AOmdnX_3T5ObO0r8nZ2dnUU7-IHNnZ2d@earthlink.com

"1.AAC0832" <z24ba7.net> wrote in message 
news:AOmdnX_3T5ObO0r8nZ2dnUU7-IHNnZ2d@earthlink.com...
...
>   Gnat wants FOUR params ... and it's the last "map" related
>   one that's most mysterious. I'd also seen examples using
>   only TWO params ... but the compiler balks.
>
>   In any case :
>   Idx := Index
>         (Source  => S,
>          Pattern => P,
>          From    => Idx + 1);
>
>   won't compile no matter what you put in "from".

I use this sort of thing all the time (especially in the Trash-Finder spam 
filter), and it works fine. You never have to give the 4th parameter in 
these routines as they have a defined default which allows you to omit them. 
So it's highly likely that you've done something else wrong which is why 
nothing you try works.

But you've given so little detail about your program, it's impossible to 
help. Ada resolution can be finiky, especially when a routine is overloaded 
as Index is, and that is also the case where it is difficult/impossible for 
a compiler to give an understandable error message. To get useful help 
around here, you need to provide a complete example (including all of the 
declarations and use clauses and with clauses). Otherwise, it just ends up 
being griping and people will tune you out.

For instance, in the above, I have no idea what types S, P, and Idx have --  
and that matters a lot -- Ada is a very strongly typed language.

                                          Randy.




  parent reply	other threads:[~2022-01-07  4:14 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-05  0:54 Ok - WHAT are those "Maps.Identity" things ??? 1.AAC0831
2022-01-05  5:49 ` Rod Kay
2022-01-07  2:31   ` 1.AAC0832
2022-01-07  3:39     ` Gautier write-only address
2022-01-07  4:14     ` Randy Brukardt [this message]
2022-01-10  5:13       ` 1.AAC0832
2022-01-10 10:19         ` Marius Amado-Alves
2022-01-11  5:20           ` 1.AAC0832
2022-01-07 11:48     ` G.B.
2022-01-10  4:49       ` 1.AAC0832
2022-01-05 13:01 ` Jeffrey R.Carter
2022-01-07  2:41   ` 1.AAC0832
2022-01-07  9:49     ` Jeffrey R.Carter
2022-01-10  4:46       ` 1.AAC0832
2022-01-10 15:05         ` Simon Wright
2022-01-11  5:17           ` 1.AAC0832
2022-01-11 11:33             ` Niklas Holsti
2022-01-12  4:22               ` 1.AAC0832
replies disabled

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