Re: [Camllist] possible to define a type where = is forbidden ?
[
Home
]
[ Index:
by date

by threads
]
[ Message by date: previous  next ] [ Message in thread: previous  next ] [ Thread: previous  next ]
[ Message by date: previous  next ] [ Message in thread: previous  next ] [ Thread: previous  next ]
Date:   (:) 
From:  Thomas Fischbacher <Thomas.Fischbacher@P...> 
Subject:  Re: [Camllist] EQ hash tables? 
On Wed, 12 Oct 2005, Xavier Leroy wrote: > Alternatively, you can always put > unique integers in the data type used as key. Suppose I define: type network = Links of network array and now, I set out to construct a wildly linked such network, which may indeed have the property that it "looks the same" from different places. Let us assume, for example, that entities of type network represent elements of a discrete group that is spawned by two generators, and the entries in Links [a,b,a_inv,b_inv] are the elements that are reached by leftapplication of the group generators A, B, or their inverses. How would one write a function that counts the sites in such a network? With proper EQ hash tables, it's quite easy.  regards, tf@cip.physik.unimuenchen.de (o_ Thomas Fischbacher  http://www.cip.physik.unimuenchen.de/~tf //\ (lambda (n) ((lambda (p q r) (p p q r)) (lambda (g x y) V_/_ (if (= x 0) y (g g ( x 1) (* x y)))) n 1)) (Debian GNU)