[changes to interface kindbind semantics
raph.levien@gmail.com**20060701033608
 
 This patch changes the way kindbind in .ghi files are interpreted, and
 fixes some kind/interface bugs along the way. In the new semantics,
 importing an interface with a kindbind statement causes the two kinds
 to be unified. Exporting an interface with a kindbind checks whether
 the two kinds are actually the same. In both cases, it's expected that
 both kinds in the kindbind are defined in the kind namespace.
] {
hunk ./gh_verify.py 172
-            return v[1]
+            return self.kinds[v[1]]
hunk ./gh_verify.py 181
-                if self.kindof_exp(exp[i + 1], syms) != v[2][i]:
-                    raise VerifyError('kind mismatch: ' + `exp`)
-            return v[1]
+                child_kind = self.kindof_exp(exp[i + 1], syms)
+                if child_kind != self.kinds[v[2][i]]:
+                    #print self.kinds
+                    raise VerifyError('kind mismatch: ' + sexp_to_string(exp) + ' wanted ' + self.kinds[v[2][i]] + ' got ' + child_kind)
+            return self.kinds[v[1]]
hunk ./gh_verify.py 214
-                    if not kind_map.has_key(k_old):
+                    if not kind_map.has_key(local_k_old):
hunk ./gh_verify.py 216
-                    if self.kinds.has_key(k_new):
-                        raise VerifyError('kind already defined: ' + k_new)
+                    if not kind_map.has_key(local_k_new):
+                        raise VerifyError('kind not known: ' + k_new)
hunk ./gh_verify.py 219
+                    # Note: the next three statements are mutations. The
+                    # goal is to unify k_old and k_new in the kind maps.
hunk ./gh_verify.py 301
-                    if not kind_map.has_key(k_old):
+                    if not kind_map.has_key(local_k_old):
hunk ./gh_verify.py 303
-                    if not self.kinds.has_key(k_new):
-                        raise VerifyError('kind not bound: ' + k_new)
+                    if not kind_map.has_key(local_k_new):
+                        raise VerifyError('kind not known: ' + k_new)
hunk ./gh_verify.py 307
-                    k = self.kinds[k_old]
-                    kind_map[local_k_new] = k
-                    kind_map_new[local_k_new] = k
hunk ./gh_verify.py 317
-                    kind = kind_map[local_kind]
+                    kind = self.kinds[kind_map[local_kind]]
hunk ./gh_verify.py 332
-                        ks = [kind_map[el] for el in k[1:]]
+                        ks = [self.kinds[kind_map[el]] for el in k[1:]]
hunk ./gh_verify.py 620
-	for v in varmap:
+	for k, v in varmap.items():
}
