Hashtables (also called dictionaries, maps, or associative arrays) are data structures that allow you to store named items. They are similar to Python's dictionaries. For example:
d = {"foo" : "bar", "spam" : "eggs"}
print d["foo"]
emptydict = {}
print d.GetType()
Boo's hash class is defined in Boo.Lang.Hash, which is a subclass of the standard System.Collections.Hashtable class. See that page for more documentation about the methods and properties that boo's hashtable inherits.
If you haven't already, you should learn about Lists And Arrays also.
Here is a sample of things you can do with a dictionary:
d = {"foo" : "bar", "spam" : "eggs"}
print "d has ${d.Count} items"
d["test"] = "new item"
print "d has ${d.Count} items"
d["foo"] = "barbar"
for item in d: print item.Key, ":", item.Value
for key in d.Keys:
print key, "->", d[key]
if d.ContainsKey("foo"):
print "has key foo"
if d.ContainsValue("eggs"):
print "has value eggs"
print "first key:", array(d.Keys)[0]
print "first value:", array(d.Values)[0]
items = array((item.Key, item.Value) for item in d)
d.Remove("test")
item = d["badkey"] or "default value"
See also Lists And Arrays.