From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-0.0 required=3.0 tests=BAYES_20 autolearn=ham autolearn_force=no version=3.4.6 Path: eternal-september.org!reader02.eternal-september.org!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!buffer2.nntp.dca1.giganews.com!nntp.earthlink.com!news.earthlink.com.POSTED!not-for-mail NNTP-Posting-Date: Tue, 04 Jan 2022 18:54:14 -0600 Newsgroups: comp.lang.ada X-Mozilla-News-Host: news://news.west.earthlink.net:119 From: "1.AAC0831" Subject: Ok - WHAT are those "Maps.Identity" things ??? Date: Tue, 4 Jan 2022 19:54:08 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Message-ID: X-Usenet-Provider: http://www.giganews.com NNTP-Posting-Host: 98.77.165.67 X-Trace: sv3-EZnu65s9PxAf1K6ngD0BmagfWvrycLGGCunKAceEV8SABDZobJ4+N8Fr8mCZkXPcyljjObgdQRdlh9s!FUEGHuZ+lejniG1H7WSntPL+fi/oK3zVfzkj/XGU5+mT330CYxORGQY0MdRgACPY1HknM4IQOu3m!AJFhPqbJV5jktVu8nfs= X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 3935 Xref: reader02.eternal-september.org comp.lang.ada:63340 List-Id: 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,,) 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).