comp.lang.ada
 help / color / mirror / Atom feed
From: sbelmont700@gmail.com
Subject: Re: Hash Type Size
Date: Sat, 31 Aug 2013 08:57:32 -0700 (PDT)
Date: 2013-08-31T08:57:32-07:00	[thread overview]
Message-ID: <782ef090-7299-4164-b4e5-14a06d1c1a44@googlegroups.com> (raw)
In-Reply-To: <7aa26916-cde1-46f8-9f49-d9ebcc2dee93@googlegroups.com>


To be honest, this was mostly just laziness on my part; there is no good (read: easy) way to hash an opaque data type, and so a quick and dirty (and admittedly 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/access value/system.address?"

It would be nice if there was a interface exclusively for doing this; something like an 'Hash attribute that could be applied to any type to return either a implementation-provided hash (like for strings) or that could be overridden by a programmer in fancier cases.  You can already sort of hack it together now using Ada.Strings.Hash(T'Image(o)).

  reply	other threads:[~2013-08-31 15:57 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-18 21:05 Hash Type Size sbelmont700
2013-08-19  1:03 ` AdaMagica
2013-08-19 22:21   ` Randy Brukardt
2013-08-19 22:29     ` Randy Brukardt
2013-08-19 22:12 ` Randy Brukardt
2013-08-31  6:22   ` Peter Brooks
2013-08-31 15:57     ` sbelmont700 [this message]
2013-09-03  1:47       ` Randy Brukardt
2013-09-03  2:31         ` Peter Brooks
2013-09-03 10:50           ` John B. Matthews
2013-09-03 17:18             ` Peter Brooks
2013-09-03 21:21               ` John B. Matthews
2013-09-04  4:50               ` Paul Rubin
2013-09-04  4:54                 ` Paul Rubin
2013-09-05 19:30                   ` John B. Matthews
replies disabled

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