comp.lang.ada
 help / color / mirror / Atom feed
* Ok - WHAT are those "Maps.Identity" things ???
@ 2022-01-05  0:54 1.AAC0831
  2022-01-05  5:49 ` Rod Kay
  2022-01-05 13:01 ` Jeffrey R.Carter
  0 siblings, 2 replies; 18+ messages in thread
From: 1.AAC0831 @ 2022-01-05  0:54 UTC (permalink / raw)



I'll try to squeeze in between the "Hot Lezbo Action" spam ...

Ok ... ADA online documentation is POOR. Lots of
definitions, often NO practical examples of even
the simplest things. You'd expect more for an
"official DOD" language.

Problem : I want to find out if/where a substring
is in another string (lets assume unbounded strings).

The docs say to use Index(source,substr,<something>,<something-identity>)

Well, I can guess what the first two are. The third probably
is "forward" or maybe '1' for "start at first'. However all
examples of Index have some kind of mapping param for #4
and I've used every search engine and CANNOT figure out what
goes in there.

Sure, I can take progressive slices of the source and compare
them to the substring - the HARD old-fashioned way - but so
long as there's a library function I'd like to know how
to USE the thing. Not a single comprehensible example in
the whole world. There are a lot of string-related functions
that look useful, and most use this mystery 'mapping' thing.
Oh yea, just doing x:=Index(src,sub) generates a "no
candidates" error in Gnat.

I just finished a sort of managed list thing for text
files that sort of does what FPC tStringList can do.
Linked-list of named stringlists and vital params and
access (pointers) to another linked list that actually
holds the text strings. Advantage ... you don't have to
know how many lines are in the text file - could be
one, could be a million, so you don't have to guess
about the size of the holding array. If you need to
use several named lists just add something to that name
and it sets itself up.

All that works fine. The very last thing I wanted to
add was a "is substring in string" function - might
return a boolean, but I might cheat and return a real
with the listindex .point. position-in-str sort of format.

Thought I should learn some Ada "just because". It's a
very picky language. I suppose that makes it "safer"
but come ON now ! I want to escape to good old 'C'
and Pascal now (actually I've changed most of my Python
apps over to FPC/Delphi of late because interpreted
languages are awkward unless you use Cython or something
to turn 'em into executables. Alas no matter what you
do they are STILL kinda hostage to the exact version
of Python on the machine ............

Anyway, yes, some people ARE still interested in some
of these "old" computer languages. I even wrote a little
FORTRAN pgm, first I'd done in like 30+ years. The newer
versions ARE easier than the old "this goes in THIS
column, that goes in THAT column"  :-) Algol68 is
underdocumented (and kinda weird) and the current GM2
modula-2 in the linux repos doesn't seem to work as
advertized (haven't quite got the modula-3 compiler
up and going yet, but I WILL).

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

end of thread, other threads:[~2022-01-12  4:22 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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