comp.lang.ada
 help / color / mirror / Atom feed
From: Duncan Sands <baldrick@free.fr>
To: comp.lang.ada@ada-france.org
Cc: Mark Lorenzen <mark.lorenzen@surfpost.dk>
Subject: Re: Hashing on System.Address
Date: Tue, 14 Jun 2005 09:23:48 +0200
Date: 2005-06-14T09:23:48+02:00	[thread overview]
Message-ID: <mailman.22.1118733848.17633.comp.lang.ada@ada-france.org> (raw)
In-Reply-To: <m3mzpuymd6.fsf@0x535ba172.boanxx18.adsl-dhcp.tele.dk>

Hi Mark,

> You can always convert a value of type System.Address to a value of a
> signed or modular (implementation-defined) type. That should help when
> you want to hash it into a value of type Hash_Type.

yes that helps - thanks for the suggestion.  In fact that is what I'm already
doing.  The problem is the next part...  That can be simplified to: I have two
modular types (binary modulus), but I don't know their modulus.  Values of
the first type should be hashed into values of the second type.  This can be
done (I've done it) but somehow the code is much more horrible than I feel
it should be.  One annoying point is that a program with a static expression
that would raise Constraint_Error is illegal, even if you would never get to the
Contraint_Error raising part in run-time.  If you don't understand the relevance
of this remark, try to code this kind of hash thing yourself and you will soon
see :)

Thanks again,

Duncan.



  reply	other threads:[~2005-06-14  7:23 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-13 20:18 Hashing on System.Address Duncan Sands
2005-06-13 21:31 ` Mark Lorenzen
2005-06-14  7:23   ` Duncan Sands [this message]
2005-06-14 20:18     ` Randy Brukardt
2005-06-15  7:27       ` Duncan Sands
2005-06-13 21:57 ` Matthew Heaney
2005-06-13 23:41   ` Robert A Duff
2005-06-14  2:22     ` Matthew Heaney
2005-06-14  7:27       ` Duncan Sands
2005-06-14  8:52         ` Alex R. Mosteo
2005-06-14  9:06           ` Duncan Sands
2005-06-14  9:09           ` Duncan Sands
2005-06-14 17:00             ` Pascal Obry
2005-06-14 20:03             ` Randy Brukardt
2005-06-14 23:20               ` Robert A Duff
2005-06-15  7:13               ` Duncan Sands
2005-06-14  8:44       ` Larry Kilgallen
2005-06-14 10:03       ` Marius Amado Alves
     [not found]       ` <abb2a2c53e3708803aa68bb87834b7bc@netcabo.pt>
2005-06-14 10:14         ` Duncan Sands
     [not found]         ` <200506141214.14213.baldrick@free.fr>
2005-06-14 10:29           ` Marius Amado Alves
     [not found]           ` <64f19b6707e4d19f5362900bbfb80b76@netcabo.pt>
2005-06-14 10:49             ` Marius Amado Alves
2005-06-14  8:42     ` Larry Kilgallen
2005-06-14 11:18     ` Duncan Sands
2005-06-14  7:18   ` Duncan Sands
2005-06-14 15:18     ` Matthew Heaney
2005-06-14 16:22       ` Duncan Sands
replies disabled

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