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.2 required=5.0 tests=BAYES_00,FREEMAIL_FROM, FROM_STARTS_WITH_NUMS autolearn=no autolearn_force=no version=3.4.4 X-Received: by 2002:a24:a34b:: with SMTP id p72-v6mr6431901ite.52.1525087696850; Mon, 30 Apr 2018 04:28:16 -0700 (PDT) X-Received: by 2002:a9d:3c4:: with SMTP id f62-v6mr946942otf.8.1525087696381; Mon, 30 Apr 2018 04:28:16 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!news.uzoreto.com!weretis.net!feeder6.news.weretis.net!feeder.usenetexpress.com!feeder-in1.iad1.usenetexpress.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!f63-v6no2156133itc.0!news-out.google.com!b185-v6ni3510itb.0!nntp.google.com!f63-v6no2156131itc.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Mon, 30 Apr 2018 04:28:16 -0700 (PDT) In-Reply-To: <1c73f159-eae4-4ae7-a348-03964b007197@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=85.240.223.129; posting-account=rhqvKAoAAABpikMmPHJSZh4400BboHwT NNTP-Posting-Host: 85.240.223.129 References: <1c73f159-eae4-4ae7-a348-03964b007197@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <6ea9e4a2-0c79-4e70-974b-f6e09534011d@googlegroups.com> Subject: =?UTF-8?B?UmU6IEhvdyB0byBnZXQgQWRhIHRvIOKAnGNyb3NzIHRoZSBjaGFzbeKAnT8=?= From: Mehdi Saada <00120260a@gmail.com> Injection-Date: Mon, 30 Apr 2018 11:28:16 +0000 Content-Type: text/plain; charset="UTF-8" X-Received-Bytes: 2153 X-Received-Body-CRC: 2336169544 Xref: reader02.eternal-september.org comp.lang.ada:51828 Date: 2018-04-30T04:28:16-07:00 List-Id: For dictionnaries, you can instantiate ada.strings.bounded ou unbounded, to get a variable-length string, then instantiate Ada.containers.bounded_hashed_maps like this: first you have to overload the hash function a bit since it takes only the type String. function Hash(A: your_string_type) is (ada.string.Hash(To_String(A))); then you create your hashed map package: package hashed_maps is new ada.containers.bounded_hashed_maps (Key_Type => your_string_type, Element_Type => another_string_type, Hash => Ada.string.Hash, Equivalent_Keys => "="); and there you have your dictionary. DIct: Map (Nombre_de_mots_max, Default_modulus(Nombre_de_mots_max)); I let you understand the subprograms, but most of them are self-evident, and repeat themselves all over the containers libraries. Sure, there are no containers aggregates which would make the syntax more natural as in Python, but it's being studied for the next Ada. It doesn't hinder the use so much, though.