The hash expression loops a variable through a list, dictionary or integer range, evaluating an expression for each iteration. Results from each iteration must be contained within a two element list. The list is inserted as the key/value pair into a dictionary. After the loop completes the final dictionary is returned. The syntax for hash can be either of the following:
hash x in ([1, 2, 3]) to ([toobjnum(x).name(), x])
=> #[["$root", 1], ["Brandon", 2], ["Dancer", 3]]
hash x in [1 .. 3] to (.random_pair())
=> #[["Dancer", 1], ["Miro", 7], ["$root", 1]]
In the above example the method .random_pair() returns a random two element key/value pair.