X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=src%2Fnode.ml;fp=src%2Fnode.ml;h=78f089909034ff196106eec93ccd6745afd5c6ad;hb=4b52da1a20a4fe031930bb96d2ca46bec06dc529;hp=0000000000000000000000000000000000000000;hpb=a223af3254fb51c279cfbccdc18c59484fdca74e;p=SXSI%2Fxpathcomp.git diff --git a/src/node.ml b/src/node.ml new file mode 100644 index 0000000..78f0899 --- /dev/null +++ b/src/node.ml @@ -0,0 +1,15 @@ +type 'a t = int + + +let nil = ~-1 +let null = 0 +let is_nil x = x == ~-1 +let print fmt = Format.fprintf fmt "%i" + +let equal (x : 'a t) (y : 'a t) = x == y +external ibool : bool -> int = "%identity" +let compare (x : 'a t) (y : 'a t) = ibool (y > x) - ibool (y < x) +let hash (x : 'a t) = x land 0x7fffffff + +external to_int : 'a t -> int = "%identity" +external of_int : int -> 'a t = "%identity"