🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.prolog
Article #201

Re: ?: Efficient implementation of HASHING in PROLOG

#201
From: Richard A. O'Keefe
Date: Wed, 15 Apr 1992 04:44
16 lines
1187 bytes
In article <1992Apr14.181452.6752@quintus.com>, ludemann@quintus.com (Peter Ludemann) writes:
> And in some Prologs, the hashing function is available to programmers,
> so that complex terms can be hashed.  So, for example, you can do:
> 
> foo(X,Y,Z) :- hash_term(X-Y,Hash), foo2(Hash,X,Y,Z).
> 
> add_foo(X,Y,Z) :- hash_term(X-Y,Hash), assertz(foo2(Hash,X,Y,Z)).

Note that the predicate SHOULD be called term_hash(Term, Hash);
with the name hash_term/2 one expects the hash argument to precede
the term argument.

-- 
I am writing a book on debugging aimed at 1st & 2nd year CS students using
C/Modula/Pascal-like languages.  Please send suggestions (other than "you
_must_ cite "C Traps and Pitfalls") to ok@goanna.cs.rmit.oz.au
Technical Details
Message-ID: <10280@goanna.cs.rmit.oz.au>
Path: arc1-ca.pugleaf.net!sparky!uunet!munnari.oz.au!goanna!ok
References: <1992Apr8.234624.7922@cl.cam.ac.uk> <1992Apr14.181452.6752@quintus.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!munnari.oz.au!goanna!ok
From: ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe)
Newsgroups: comp.lang.prolog
Subject: Re: ?: Efficient implementation of HASHING in PROLOG
Keywords: Prolog, Hashing
Message-ID: <10280@goanna.cs.rmit.oz.au>
Date: 15 Apr 92 04:44:16 GMT
References: <1992Apr8.234624.7922@cl.cam.ac.uk> <1992Apr14.181452.6752@quintus.com>
Organization: Comp Sci, RMIT, Melbourne, Australia
Lines: 16