Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: Removing a key-value pair from a hash?

From: greggirwin:mindspring at: 23-Feb-2002 11:02

Hi Alex, << How would one write a function to take a hash and a key, and remove the key and the value that key is associated with from the hash? With O(1) time, preferably. >> remove-key-val-pair: func [hash key] [ if found? find/skip hash key 2 [ remove/part find/skip hash key 2 2 ] hash ] I haven't tested it for performance and I don't know what FIND and REMOVE do, internally, when operating on a hash!. --Gregg