Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!wuarchive!mit-eddie!uw-beaver!cornell!rochester!pt.cs.cmu.edu!dsl.pitt.edu!pitt!willett!ForthNet From: ForthNet@willett.pgh.pa.us (ForthNet articles from GEnie) Newsgroups: comp.lang.forth Subject: Conventions and "tricks" used in Forth Message-ID: <1812.UUL1.3#5129@willett.pgh.pa.us> Date: 5 Oct 90 03:27:27 GMT Organization: String, Scotch tape, and Paperclips. (in Pgh, PA) Lines: 32 Date: 09-27-90 (12:24) Number: 3860 (Echo) To: IAN WATTERS Refer#: 3858 From: CHARLIE HITSELBERGER Read: NO Subj: HASHING THE DICTIONARY Status: PUBLIC MESSAGE Here's my function to hash the dictionary. It's go [garbage in message elided. -dwp] eal thing, but for all you deprived souls without a 6502, here's the high-level def. : HASH ( ADDR -- N ; assume a counted string address ) 0 OVER C@ 127 AND 1+ 0 DO OVER I + C@ XOR LOOP SWAP DROP 16 /MOD XOR ; Now, for my next trick, I'll create a table of 16 words at the very bottom of the dictionary. These words will point to the last word in the dictionary for that particular hash-thread. All hash threads will wind up by pointing to the lowest word in the dictionary, which in turn will link to a "0000" (end of linked list). I figured that was cleaner to link everything into one tail, rather than to have 16 vocabulary tails. Please, somebody, stop me if I am a fool. I have never rolled a compiler before, and I go to sleep every night with the nagging feeling that somehow I am really messing this up and will regret it later. ----- This message came from GEnie via willett through a semi-automated process. Report problems to: dwp@willett.pgh.pa.us or uunet!willett!dwp