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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ac39a12d5faf5b14 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-04-24 13:01:50 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed1.uni2.dk!dax.net!juliett.dax.net!not-for-mail Newsgroups: comp.lang.ada Subject: Re: Grace and Maps (was Re: Development process in the Ada community) References: <3CB46975.90408@snafu.de> <3CBAFFEE.2080708@snafu.de> <4519e058.0204171036.6f0a7394@posting.google.com> <3CBDD795.4060706@snafu.de> <4519e058.0204180800.44fac012@posting.google.com> <3CBF0341.8020406@mail.com> <4519e058.0204190529.559a47ae@posting.google.com> <3CC1C6B3.6060306@telepath.com> <3CC21747.5000501@telepath.com> <4519e058.0204220534.2eb33730@posting.go <3CC48F34.5A474E0F@boeing.com> <3CC49C50.485AE213@san.rr.com> <3CC4B5C0.4D16077C@acm.org> <3CC4E9DA.E02BE0DA@san.rr.com> <7vznzukhzf.fsf@vlinux.voxelvision.no> <3CC5B161.C719C5D8@san.rr.com> <7vg01lwaku.fsf@vlinux.voxelvision.no> <3CC6B932.75C468E1@san.rr.com> <7vbsc9w367.fsf@vlinux.voxelvision.no> From: Ole-Hjalmar Kristensen Message-ID: <7vlmbcvpbx.fsf@vlinux.voxelvision.no> User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 24 Apr 2002 20:01:06 GMT NNTP-Posting-Host: 193.216.12.150 X-Complaints-To: abuse@tele2.no X-Trace: juliett.dax.net 1019678466 193.216.12.150 (Wed, 24 Apr 2002 22:01:06 MET DST) NNTP-Posting-Date: Wed, 24 Apr 2002 22:01:06 MET DST Organization: Tele2 Norway AS Public Access Xref: archiver1.google.com comp.lang.ada:23082 Date: 2002-04-24T20:01:06+00:00 List-Id: "Randy Brukardt" writes: > Ole-Hjalmar Kristensen wrote in message > <7vbsc9w367.fsf@vlinux.voxelvision.no>... > >Darren New writes: > > >> how to do this in Ada, tho - it would seem that every private type > >> (for example) would have to implement its own hash > >> function. Wouldn't it? > > > >Hmm. What's wrong with having a generic hash function which you > >instantiate for your private type? Provided that you can read the key > >as an array of bytes, it should work the same in both C and Ada. I > >know this is low-level and dirty, but for hashing, I think it's a > >reasonable approach. > > > Actually, it doesn't even need to be generic. It is easy to write a > hashing algorithm that works with any type that can be streamed (use > streaming operations to convert to an array of stream elements, hash > that) -- I've seen two such implementations in the last few days. > > Using streams to do this has the advantage of eliminating packing and > implementation-defined components from concern. It does limit the > applicability of the package to non-limited keys, but that seems to be > an acceptable limitation (do you really need to hash tasks??). > > Randy. Excellent idea, unless there is much overhead involved in the streaming operation. But I suspect it's probably OK.