comp.lang.ada
 help / color / mirror / Atom feed
From: "1.AAC0832" <z24ba7.net>
Subject: Re: Ok - WHAT are those "Maps.Identity" things ???
Date: Mon, 10 Jan 2022 00:13:43 -0500	[thread overview]
Message-ID: <QsSdnadOQ8MVXUb8nZ2dnUU7-I3NnZ2d@earthlink.com> (raw)
In-Reply-To: <sr8emg$u51$1@franka.jacob-sparre.dk>

On 1/6/22 11:14 PM, Randy Brukardt wrote:
> "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.

   Yes ... VERY  :-)

   Hate typing long things ... made one-liners S2U() and
   U2S() if you can guess what those are  :-)

   Unfortunately Gnat often gives rather generic, useless,
   error messages. Not helpful. SOMETHING is wrong, but WHAT ?
   You'd swear it was a Microsoft product ..........

   Someone else here says that with unbounded searching the
   "needle" is a straight-up string, not an unbounded. I'll
   have to experiment.

   Anyway, thanks for the help. This group has so much spam
   I wondered if there were any real programmers here. Ada
   is worth knowing something about.

   Did get my fancy linked-list of linked-lists setup to
   work correctly though  :-) Had to write my own string-in-string
   finder alas. But, more experiments are warranted. Still
   wish those last two params had better docs ... they are
   in rather a lot of library functions related to unboundeds.
   It's kind a "Why, EVERYONE JUST KNOWS" thing ...

   ANYway ... I like experiments. Some Ada is worth knowing.
   Set up CP/M-86 on a VM recently and found an Aztec 'C'
   compiler for it - retro FUN ! All work and no play ....

   Oh, speaking of docs, that Aztec compiler docs were clearly
   NOT written by some hired "technical writer" but by the
   people who were hands-on writing the compiler. PAGES on
   how binary stuff got set up, and how various compiler
   flags could affect it. Memory and speed were PRECIOUS
   back then ....

  reply	other threads:[~2022-01-10  5:13 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
2022-01-10  5:13       ` 1.AAC0832 [this message]
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