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.224.36.198 with SMTP id u6mr15703147qad.6.1377964652814; Sat, 31 Aug 2013 08:57:32 -0700 (PDT) X-Received: by 10.49.59.35 with SMTP id w3mr81474qeq.8.1377964652802; Sat, 31 Aug 2013 08:57:32 -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!usenet.blueworldhosting.com!feeder02.blueworldhosting.com!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!fx3no6326388qab.0!news-out.google.com!p7ni0qas.0!nntp.google.com!fx3no6326386qab.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sat, 31 Aug 2013 08:57:32 -0700 (PDT) In-Reply-To: <7aa26916-cde1-46f8-9f49-d9ebcc2dee93@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=206.53.78.59; posting-account=ShYTIAoAAABytvcS76ZrG9GdaV-nXYKy NNTP-Posting-Host: 206.53.78.59 References: <1679ec49-424b-43bd-8f35-a5f69e658112@googlegroups.com> <7aa26916-cde1-46f8-9f49-d9ebcc2dee93@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <782ef090-7299-4164-b4e5-14a06d1c1a44@googlegroups.com> Subject: Re: Hash Type Size From: sbelmont700@gmail.com Injection-Date: Sat, 31 Aug 2013 15:57:32 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Received-Bytes: 1984 Xref: news.eternal-september.org comp.lang.ada:17068 Date: 2013-08-31T08:57:32-07:00 List-Id: To be honest, this was mostly just laziness on my part; there is no good (r= ead: easy) way to hash an opaque data type, and so a quick and dirty (and a= dmittedly non-ideal) way to simply use the pointer as the key itself. But = this is a lot tougher to rationalize now that they are different sizes, so = I guess the real question is "what's a good way to hash a private type/acce= ss value/system.address?" It would be nice if there was a interface exclusively for doing this; somet= hing like an 'Hash attribute that could be applied to any type to return ei= ther a implementation-provided hash (like for strings) or that could be ove= rridden by a programmer in fancier cases. You can already sort of hack it = together now using Ada.Strings.Hash(T'Image(o)).