From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.66.188.37 with SMTP id fx5mr355650pac.45.1379429484505; Tue, 17 Sep 2013 07:51:24 -0700 (PDT) X-Received: by 10.49.3.134 with SMTP id c6mr1713514qec.0.1379429484277; Tue, 17 Sep 2013 07:51:24 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.glorb.com!z6no7481653pbz.1!news-out.google.com!rn2ni87842pbc.1!nntp.google.com!d5no308597qap.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Tue, 17 Sep 2013 07:51:24 -0700 (PDT) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=105.236.35.136; posting-account=p-xPhAkAAADjHQWEO7sFME2XBdF1P_2H NNTP-Posting-Host: 105.236.35.136 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <4f66d847-d030-4aa9-8bdf-9bcc5f3a0852@googlegroups.com> Subject: Multiple keys for a map From: Peter Brooks Injection-Date: Tue, 17 Sep 2013 14:51:24 +0000 Content-Type: text/plain; charset=ISO-8859-1 Xref: news.eternal-september.org comp.lang.ada:17192 Date: 2013-09-17T07:51:24-07:00 List-Id: I know that maps in Containers.Hashed_Maps and Containers.Ordered_Map are designed as single-key look-up tables. Is there an extension that allows multiple keys? I'd like to be able to do something like this: procedure Insert (Container : in out Map; key1, key2, key3 : in Key_Type; New_Item : in Element_Type; Position : out Cursor; Inserted : out Boolean); allowing: insert(my_map,"fox","jumps","dog","The quick brown fox jumps over the lazy dog",location,succeeded); insert(my_map,"cow","jumps","moon","The cow jumps over the moon",location,succeeded); insert(my_map,"dog","jumps","log","The lazy dog jumps over the small log",location,succeeded); insert(my_map,"dog","jumps","bed","The very lazy dog jumps into bed",location,succeeded) So that later, I can have: Subject := find(my_map,"fox",-,-); Verb := find(my_map,-,"jumps",-); Object := find(my_map,-,-,"dog"); and, after this: Subject = Verb = Object; I know this could be done with three calls to Insert, but I also want to be able to call: find(mymap,"fox","jumps","dog") => true and find(mymap,"dog","jumps","fox") => false and, ideally, find(myman,"dog",-,-) => "The Lazy dog jumps over the small log" "The very lazy dog jumps into bed" Any suggestions?