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

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

From: stopm::mediaone::net at: 23-Feb-2002 2:44

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. Here's an example (let's call our function search-remove): the-hash: make hash! ["si" "yes" "hola" "hello"] search-remove the-hash "hola" After this expression was complete, the-hash would have the value: make hash! ["si" "yes"] Alex