Arc Forumnew | comments | leaders | submitlogin
3 points by thaddeus 5322 days ago | link | parent

There are many options - here are a few:

  arc> (= myhashtable (obj 1 "One" 2 "Two"))
  #hash((1 . "One") (2 . "Two"))

  1.
  arc> (each key (keys myhashtable) 
         (prn "key " key " val " myhashtable.key))

  key 2 val Two
  key 1 val One

  2. 
  arc> (each (k v) myhashtable 
            (prn "key " k " val " v))
  key 2 val Two
  key 1 val One
  #hash((1 . "One") (2 . "Two"))

  3.
  arc> (each item myhashtable 
         (prn item))

  (2 Two)
  (1 One)
  #hash((1 . "One") (2 . "Two"))
There's a bunch more documented here:

http://files.arcfn.com/doc/iteration.html